Windows 2008 task scheduler returns code 1, without registration

trying to run a simple batch file in the Windows 2008 task scheduler

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

The action starts up properly, and from the history logs (7 informational messages) it seems puzzling

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

Unfortunately, nothing is executed (since the logs are not created), even if I run the task manually, of course, the batch file works fine if it is executed from the OS. If I do not use the "call" in the batch file, then "return code 0" is displayed, but nothing is executed.

+3
source share
1 answer

At first I had to convert the task scheduled as "Windows Server 2003, Windows Xp or Windows 200", after which I was able to debug this placement

"call timeout 5"

at the end of the script and found out that the ant environment was not properly loaded, so the commands did not execute.

0
source

All Articles