3

trying to run a simple batch file in windows 2008 task scheduler

call cleanup.bat > cleanup.log;
call ant -f ongoing_changes.xml > automation.log

The action is triggered properly and from the History logs (7 information messages) this seems to be puzzling

Task Scheduler successfully completed task "\Run regression" , instance "{edbd26d2-b71b-43d6-960f-29c31e39493c}" , action "C:\Windows\SYSTEM32\cmd.exe" with return code 1.

Unfortunately nothings gets executed (as no logs are created), even if I trigger manually the task, of course the batch file runs fine if executed from OS. If I don't use "call" in the batch file, then "return code 0" is presented, still nothing gets executed.

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
Tiberiu
  • 2,870
  • 3
  • 20
  • 17

1 Answers1

0

First I had to convert the task scheduled to be "Windows server 2003, Windows Xp or Windows 200" then I managed to debug this putting a

"call timeout 5"

at the end of the script and figured out that ant environment wasn't properly loaded, thus commands were failing.

Tiberiu
  • 2,870
  • 3
  • 20
  • 17