Task Scheduler Problem (run whether user is logged on or not)
I'm having a problem with scheduling a task in Windows 7 Home Premium. I have been having problems getting tasks to launch appropriately, so I set up a basic task as a test. I set it to open Calculator at a specific time. I then added options one at a time until I got the same failure to launch that I was getting on my previous tasks. The Calculator test task works as long as it is set for "Run only when user is logged on." As soon as I change the option to "Run whether user is logged on or not", the task fails to launch the application. The task starts (the status says "Running") but Calculator does not start up. I did not change any other option. This happens whether "Do not store password" is checked or not. Why would the "Run whether the user is logged on or not" option cause the task to fail? Is there a way to fix this? Thanks, LDL
February 5th, 2010 7:41pm

There is some pertinent info for your issue in the Task Security Context topic in the Scheduler help file...Specifically, it says, "...select the radio button labeled Run whether user is logged on or not. If this radio button is selected, tasks will not run interactively. To make a task run interactively, select the Run only when user is logged on radio button."I guess the concept here is that a task requiring a user interface is simply not going to be allowed to present that user interface to a different user (or to someone passing by the computer when no user is logged-on).That's probably not the answer you wanted, but it's possible that you don't actually NEED a user interface, and if so your testing methodolgy is a bit flawed. Instead of trying to bring up Calculator, try making a small batch file that echoes a message into a log file.I know I run backup batch files on a schedule, with a command line interface (and output redirected to a file). It never pops up any kind of window, but it always runs.-Noel
Free Windows Admin Tool Kit Click here and download it now
February 5th, 2010 9:09pm

I just tried running a batch file, and it didn't run either. Again, it worked fine when I selected "Run only when user is logged in." I should have pointed out that every time I've tried to run my test task, I've still been logged in. It runs when I'm logged in and the "run only when user is logged in" radio button is selected, but it doesn't run when I'm logged in and the "run whether the user is logged in or not" radio button is selected. Edited to add: My end goal is to load a few websites, start up my RSS reader, and download a podcast or two about a half hour before I wake up. I lock my computer at night (and require a password to log on), and I'd like to run these tasks and have them ready to go when I start it back up in the morning. Is this even possible?
February 5th, 2010 9:37pm

That's what you'd expect of an interactive task given the way the documentation is worded. It says it will not run interactively based on the radio button being selected, even if you're logged in.I just tested this (on Windows 7 Ultimate). I created a simple batch file with the following in it:ECHO I ran! I really did! >c:\temp\TestBat.logI scheduled it to run one time, using my account, and selected Run whether user is logged on or not. Then I logged off a couple of minutes before the scheduled time.Sure enough, when I watched the folder with another computer through the network, the TestBat.log file was created with the expected contents at the expected time.I don't know what to tell you besides "keep trying".What status did the scheduler list for the task after it should have run?-Noel
Free Windows Admin Tool Kit Click here and download it now
February 5th, 2010 9:58pm

Hi Did you manage to resolve this issue? Many thanks
March 22nd, 2010 8:35am

Still looking for answers for this particular issue. I have actually created a scheduled task on a Windows Server 2008 R2 box that kicks off a Powershell script. The script uses the robocopy command to mirror a directory on the server itself with a mapped drive to another machine on the same domain. When I manually start the scheduled task using the "Run only when user is logged on" option I can see the task run interactively and it mirrors the directories as expected. When I change the ST to use the "Run whether user is logged on or not" the script does not get executed. I understand that it will not be interactive if I run it in this manner but I do not understand why it does not run the script that contains the robocopy command. The ST reports that it completed successfully. I am using my domain account to launch the ST; I am an admin on the local server, a domain admin on the domain and I have full read/write/execute to the mapped drive I am copying to. Any ideas of what to check/update to get this set-up to work correctly? Thanks!!
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2010 1:29pm

To run the task with the option "Run whether user is logged on or not" you have to activate the option "Run with highest privileges". After activating this option the task really run whether the user is logged or not. Maybe it is helpful to configure the Actions as following: Program/script: C:\Windows\System32\cmd.exe Add argumetns (optional) : "/C C:\HelloWorld.bat" BR
July 20th, 2010 7:33am

I've got the same problem with powershell backup command. Option option "Run whether user is logged on or not" makes the script doesn't work. But it's job status is OK. I tried many different options and methods to run this script. Once I wrote whole script in one long command and scheduled it. Every time there is the same result. I mean no results when option "Run whether user is logged on or not" is on. Of course "Run with highest privileges" is on. Does anyone know of a solution? Please help! BR
Free Windows Admin Tool Kit Click here and download it now
December 29th, 2010 7:32am

That's what you'd expect of an interactive task given the way the documentation is worded. It says it will not run interactively based on the radio button being selected, even if you're logged in. I just tested this (on Windows 7 Ultimate). I created a simple batch file with the following in it: ECHO I ran! I really did! >c:\temp\TestBat.log I scheduled it to run one time, using my account, and selected Run whether user is logged on or not . Then I logged off a couple of minutes before the scheduled time. Sure enough, when I watched the folder with another computer through the network, the TestBat.log file was created with the expected contents at the expected time. I don't know what to tell you besides "keep trying". What status did the scheduler list for the task after it should have run? -Noel I copied your example, and it worked for me as well, but with another task that also calls a batch, which in turn executes an SSIS package, it does not work when it's on "run when user is logged on or not".
January 24th, 2011 5:35pm

Update: Fixed The reason the simple batch works and the more complex does not is because it was referencing a file on a mapped drive, which can have issues in this context. The fix for me was to use a direct file path reference instead of a mapped drive reference more info: http://www.networksteve.com/forum/topic.php/Running_Scheduled_Task_using_%22Run_whether_user_is_logged_on_or_n/?TopicId=10304&Posts=0 Please vote this up because it wasted half an hour of my time!
Free Windows Admin Tool Kit Click here and download it now
January 24th, 2011 5:40pm

Did you get a resolution to this matter? I have been trying to run an xcopy command in a bat file to copy files from my local Win 7 hard drive to a shared folder on another Win Vista Business machine. The bat file works fine, and it runs fine from task schedule until I select 'Run whether user is logged on or not' option, then it never runs, although the task history seems to think it has. So I changed my xcopy command so the destination was to the share path instead of mapped drive, this still didn’t work. My final attempt was to include the user name & password for the destination machine (share) in the path but this also failed. Any thoughts?
April 1st, 2011 5:53am

I also had problems with moving a file from local harddisk to a remote shared folder by a script that runs under scheduler. When the scheduler runs, it doesn't know what drives you have maped in your explorer. Use the complete network path instead. It worked for me. move somefile.txt t:\ This will not work. Try: move somefile.txt \\192.168.0.2\sharefoler\ Change to your ipaddress and sharefolder. Good luck! // Par
Free Windows Admin Tool Kit Click here and download it now
April 1st, 2011 1:36pm

thanks that did the job!
April 4th, 2011 7:39am

I had the same problem and a person with the user name "Try*3" has just answerd me and the solution is much simpler than Noel's. http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/basic-task-scheduler/7c29bd02-8160-e011-8dfc-68b599b31bf5 His solution is : "I think you have to use the Run only when user is logged on setting as that's all I could ever get to work - just because you have the thing locked does not alter the fact that it's you that is logged on." And this solution works even to run the calculator, any program with the account locked. :)
Free Windows Admin Tool Kit Click here and download it now
April 7th, 2011 1:22pm

LDL707, You have a very good question, It seems like you are having the same problem that I am having. When you Schedule a Task and Set it to Run whether user is logged on or not is checked, is an implied hidden task. http://technet.microsoft.com/en-us/library/cc722152.aspx You can specify that a task should run even if the account under which the task is scheduled to run is not logged on when the task is triggered. To do this, select the radio button labeled Run whether user is logged on or not. If this radio button is selected, tasks will not run interactively. To make a task run interactively, select the Run only when user is logged on radio button. Its a shame that the Microsoft Support person could not explicitly say that and suggest a possible solution. I first experienced this issue about 4 years ago when I was attempting to use test automation software to test applications. Today, I am still running into the same issue because I need to automate functions of a legacy user interface using .Net UI Automation, scheduled to execute in the middle of the night. I understand the need to have the desktop secure and a scheduled task running on an unlock desktop would be a risk. But after years of people talking about this issue I do not understand why the checkbox could not be relabeled and the task Run whether user is logged on or not, and the desktop locked. This would fix many problems and make UI Automation and countless other tasks run as the user expects, while running securely. It seems like a good percentage of people who use the new UI Automation framework (cool stuff) will be road blocked by this eventually and render countless applications useless. I have only found one way around this issue. You must use the radio button, Run only when user is logged on, stay logged in all the time, and lock your computer. Heaven help you if you need to run automation against legacy softer on a hosted server. Microsoft, we really do need this fixed
June 17th, 2012 9:33pm

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

Other recent topics Other recent topics