Scheduled task stops working when I log out of remote desktop connection to server

remote desktopscheduled-taskwindows-server-2003-r2

I have a 'long-running' (run at startup, don't terminate) scheduled task set up to run on a server.

When I remote-desktop into the server using the same domain account as the scheduled task, and then log out of the server, the scheduled task is terminated.

Is there a way to avoid this happening?

I'm running this task under my domain account, so that it has the domain network-share permissions necessary to do its work.

Best Answer

If you start the scheduled task manually then it's running within the context of your interactive session and thus will end when your interactive session ends (ie- logout). If it's getting run during startup, outside of an interactive session, then it shouldn't die when you log out of an interactive session. The fact that it's running successfully when you start it manually leads me to believe that it's NOT running successfully during startup, assuming the HTTP server is listening on a static port. If it was running at startup then you'd get a port in use exception when you start the process manually.

If this is for more of a long term solution then I would concur that you should bake it into a service.