Running Applications with Windows 7 Task Scheduler - Weird Problem
I am logged on to my Windows 7 machine under user account "User1" (not the real name, but bear with me). This user account has local administrator privileges on this machine. My plan was to have Task Scheduler open an application I've built, at the top of the hour, run the app for a little while, and close it. However, here's the problem: When the task runs, it does, in fact, start the application. However, the application cannot be found -- either on my GUI, in the tray, or in the taskbar. When I open Task Manager and click on the Processes tab, it cannot be found in the list of running processes, either -- UNTIL I click on "Show processes from all users". Then, it appears in the list of running processes. At first blush, it simply sounds like Task Scheduler is starting the application under a different user account, but the task is configured to run the task under "User1", and in the process list, the user name shows that it's running in "User1". This issue is not limited to just MY application, either. I've also tried starting Microsoft Word from the Task Scheduler, and it treats Word the same way. I'm stumped. Thanks.
June 23rd, 2011 10:32pm

OK, after a little digging and a lot of luck, I managed to find out why this is behaving the way it is. It's called Session 0 Isolation. In Vista and later, Microsoft has separated services and applications to session 0 and session 1, respectively. Anything running on session 0 has no interaction with the user interface. Apparently, when you run an application from task scheduler (or at least when I do), it starts it in session 0. Now, my question has evolved -- is it possible to start applications in session 1 from Task Scheduler, or can I use Task Scheduler to kill applications that were started in session 0. As it stands, whenever I try to taskkill an application that was started in session 0, access is denied. Thanks!
Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2011 11:30pm

I don't have a machine with me right now but I have a suggestion, Why not create a bat file that will run your application and have TS run the bat file instead. Please tell me if it works.http://www.cesabarre.com/ | www.adm201.info
June 24th, 2011 12:47am

Cesabarre, Thanks for the reply. Yeah, I tried that. Apparently, the batch file is called in Session 0, as well, so any commands it executes are also executed in Session 0. Instead of dealing with this issue, I rewrote my application so that I don't have to worry about it. For the application that needs to interact with the UI on Session 1, I placed a shortcut in the startup folder and have written it in such a way that I never need to shut it down and restart it from Task Scheduler. Not exactly what I wanted, but it works.
Free Windows Admin Tool Kit Click here and download it now
June 28th, 2011 4:13pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics