title: Starting a Windows service in an interactive session
body: <p>A colleague has a batch script program which needs to to run on a Windows Server in console mode, so that it has access to a Windows interactive session. The server is rebooted at regular intervals automatically (there's an unrelated closed-source application that runs on this machine that we have no control over). After a reboot he wants to automatically start a Windows interactive session and have this script run, plus the service needs to also have access to network resources (CIFS drives, in particular).</p>
  
  <p>Here's what we've tried so far:</p>
  
  <ol>
  <li>Start as Windows service. This failed, since a Windows service can <em>either</em> have access to interactive session <em>or</em> to network resources, but never both.</li>
  <li>Used Microsoft management console to add the script to run at startup, however this did not work.</li>
  <li>Used an HKLM registry key to start to run this script, however it only gets started when we manually open a remote desktop session on the server.</li>
  <li>Creating a scheduled task.  The program invoked did not have access to interactive windows session.</li>
  </ol>
  
  <p>Any other suggestions?  (Or maybe he missed something when he set up one of these suggestions?)</p>