title: How do I schedule a Python script to run as long as Windows XP is running?
body: <p>I wrote a temperature logger Python script and entered it as a scheduled task in Windows XP. It has the following command line:</p>
  
  <pre><code> C:\Python26\pythonw.exe "C:\path\to\templogger.py"
  </code></pre>
  
  <p>It writes data to a file in local public folder (e.g. fully accessible by all who login locally).</p>
  
  <p><strong>So far, I was able to achieve this objective:</strong><br>
  1. Get the task to run even before anyone logs in (i.e. at the "Press <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Del</kbd>" screen)</p>
  
  <p><strong>But I'm having problems with these:</strong><br>
  1. When I log in, log out, then log back in, the scheduled task is no longer active. I can no longer see it in the Task Manager's Processes tab. I suspect it closes when I log out.<br>
  2. I tried to set the task's "Run As..." property to <code>DOMAIN\my-username</code> and also tried <code>SYSTEM</code>, but problem #1 above still persists.</p>
  
  <p><strong>SUMMARY:</strong><br>
  I want my program to be running as long as Windows is active. It should not matter whether anyone has logged in or out.</p>
  
  <p><strong>P.S.</strong><br>
  I asked <a href="https://superuser.com/questions/177730/how-do-i-keep-a-scheduled-task-running-even-though-no-user-is-logged-in-windows">the same question</a> in Super User, and I was advised to write it as a service, which I know nothing about (except starting and stopping them). I hope to reach a wider audience here at SO.</p>