Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Does the batch file work if you run it manually? – Karan Nov 30 '12 at 0:48
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
up vote 3 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .