Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have three Python scripts running overnight as scheduled tasks on a Windows Server 2008 VM. I can run them manually with no problems. But when I look at the Task Scheduler each morning, the first has run successfully and the subsequent two returned 0x1. I added an exception handler to all three scripts to log the traceback, hoping to find the guilty operation. I tested the handler by manually raising an Exception which was working fine. However, when I checked the next day no log had been created, meaning the script either never ran or didn't actually throw an error. Can anyone shed any light on what exactly 0x1 means, or if there's a situation in which the script would run but still return that?

For what it's worth, this is the batch file that calls the script:

@echo off
share|improve this question
A quick search seems to indicate that this can be caused by not specifying the correct working directory. When testing your setup, did you try to invoke the task execution through the task scheduler (there's a Run option for tasks in the library)? – Oliver Salzburg Mar 18 '13 at 18:11
Oliver, thanks for the tip, that does sound exactly like what I'm experiencing. I updated the script path to exclude the current working directory, instead specifying it in "Start in". When I run the task nothing visibly happens in the scheduler (I would expect the status to be "Running..."), but eventually it completes. Thanks again! – Jura Mar 18 '13 at 19:33

Look like this problem outside of python. May be i wrong, but by default windows allow cmd.exe execution only for logged in user. To check, add diagnostic output to cmd script

echo Run %DATE% %TIME% >> c:/tmp/file.log

share|improve this answer

I set up WinSCP and scheduled tasks a lot and I have learned that result "0x1" means exactly nothing. At best, you know that the task did not return a verbose error or it did not return a "task completed successfully" output. That leaves every other possibility, ever.

share|improve this answer

Your Answer


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.