MSFN Forum: Task Schedule problem - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Task Schedule problem windows 2008 server

#1 User is offline   zeezam 

  • Member
  • PipPip
  • Group: Members
  • Posts: 145
  • Joined: 28-March 08

Posted 30 November 2011 - 03:08 AM

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?


#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,669
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 30 November 2011 - 09:11 AM

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.

#3 User is offline   zeezam 

  • Member
  • PipPip
  • Group: Members
  • Posts: 145
  • Joined: 28-March 08

Posted 01 December 2011 - 01:47 AM

View PostTripredacus, on 30 November 2011 - 09:11 AM, said:

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.

#4 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,669
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 01 December 2011 - 09:10 AM

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.

#5 User is offline   allen2 

  • Not really Newbie
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,734
  • Joined: 13-January 06

Posted 01 December 2011 - 03:43 PM

Or check if the box "run with highest privilege" is checked.

#6 User is offline   zeezam 

  • Member
  • PipPip
  • Group: Members
  • Posts: 145
  • Joined: 28-March 08

Posted 05 December 2011 - 08:46 AM

View Postallen2, on 01 December 2011 - 03:43 PM, said:

Or check if the box "run with highest privilege" is checked.


It did the trick! :)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy