Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
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
add comment

1 Answer

up vote 2 down vote accepted

http://www.blogfodder.co.uk/2012/4/20/win-2008-task-scheduler-with-return-code-1-0x1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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