I'm trying to run a task hourly with the Task Scheduler to launch a bat file, but it is not working. Looking at the history, I see the following which looks to be the issue:

Task Scheduler successfully completed task "\Random" , instance "{c19041aa-939d-4876-a12d-456fc3e632ce}" , action "C:\Windows\SYSTEM32\cmd.exe" with return code 1.

What does return code 1 mean for cmd.exe? How can I get more verbose debugging information? My task worked at first, but then it stopped after a couple days.

  • Does the batch file work if you run it manually? – Karan Nov 30 '12 at 0:48
  • 1
    Try setting the starting folder to see if it works. – Luiz Angelo Nov 30 '12 at 1:40
  • Yes, batch file works correctly when run manually. – WilliamKF Nov 30 '12 at 12:10


Instead of putting the full file path in the program/script textbox, use the Start in (Optional) field to put the folder that the .bat file is actually in.

Once you have done this, make sure you tick the 'Run with highest privileges' tick box

And that's it. Its now returning the correct result code 0x0 and my script is running! Finally.


If your batch file uses Robocopy it might just be the exit code for that. In robocopy nonzero errorlevel doesn't necessarily mean that something went wrong.

These might be informative in such cases:



This won't really help OP anymore, but I'm posting this here because this page was in the top results of the searches I made while researching for solutions for similar issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.