Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



Sign in to follow this  
zeezam

Task Schedule problem

Recommended Posts

zeezam    0

I have created a script that copy and move a file with wget. I saved the script in .cmd.

If I manually run the script it works.

I have created a task in windows 2008 that will run the job every week.

The job seems to run in the job history but it doesn't do it's job.

Any ideas?

How to track down this?

Share this post


Link to post
Share on other sites

Tripredacus    286

You should add some error handling/logging into your script, such as creating a token somewhere (easiest copying a text file) or even writing to the Application Event Log. Basically, if a .cmd fails, you won't see it as a fail in the job history, because a .cmd will always just do a successful exit under most circumstances, since cmd doesn't really pay attention to what you are having it do. If the programs themselves are failing, they would be the one to generate the error, not cmd, which is why it doesn't "fail" in the log.

Share this post


Link to post
Share on other sites
zeezam    0

You should add some error handling/logging into your script, such as creating a token somewhere (easiest copying a text file) or even writing to the Application Event Log. Basically, if a .cmd fails, you won't see it as a fail in the job history, because a .cmd will always just do a successful exit under most circumstances, since cmd doesn't really pay attention to what you are having it do. If the programs themselves are failing, they would be the one to generate the error, not cmd, which is why it doesn't "fail" in the log.

Ok.

This must have something to do with how windows 2008 start the script or something, because if I run it manually it works.

The same script did work on a windows 2003 as a schedule task.

Share this post


Link to post
Share on other sites
Tripredacus    286

Its more likely to do with permissions. When you run it "manually" you run it under your user account. When it is run by Task Scheduler, it is run under an OS account. Try changing the account that is used to run the task.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×