Will scheduled tasks run if I am not logged in?
Solution 1
They will run, provided the account that you set the tasks to run as has rights to execute them. On a server, that's a consideration, but on an XP-based PC pretty much any account will be able to be used as a scheduled task security context.
Solution 2
Yes, they will run if not specifically set to "Run only if logged on" but your drives will not yet be mapped. So if your task executes a program which relies on a particular drive mapping it will throw an exception.
I'm mentioning this because I ran into a similar issue a few weeks ago.
Solution 3
Just to clarify further, check the scheduled task's advanced properties (right click the task >> properties) and on the "Task" tab, make sure "Run only if logged on" is unchecked. By default, if you use the "Add Scheduled Task" wizard that box is unchecked, but it never hurts to double check. Also, remember that if you ever change that account's password your tasks will break. Might sound kinda obvious, but it causes for some forehead slapping times. Hilarity ensues. =)
To make sure that the task is running when you're not logged in, open the Scheduled Tasks window (Start >> Accessories >> System Tools >> Scheduled Tasks OR run box >> control schedtasks) and look in the "Last Run Time" and "Status" Columns. See if it has even run in the first place and then check the status to see if it completed successfully or returned some error code.
Solution 4
RE: drive mapping. Another solution to mapping/unmapping is to just use the full UNC path. Then you wouldn't have to worry about whether paths are mapped correctly.
Related videos on Youtube
Micah
Updated on September 17, 2022Comments
-
Micah over 1 year
I have some tasks that are scheduled to run on XP and I am wondering if I have to be logged in for them to run? Does anyone know?
Thanks!
-
Spence almost 15 yearsGood point. Using "mapped" "drives" from scheduled tasks is typically bad mojo. If you have to, you should use a script as the scheduled task and "map" and "unmap" the "drive" during the script execution.
-
JohnyD almost 15 yearsAnd ensure that the drive mapping you're creating and destroying isn't one previously mapped by the user. You wouldn't want to stomp on an existing drive.
-
JohnyD almost 15 yearsBTW Evan, that's a good solution that I will most likely employ in the future. Thanks!
-
Josh over 13 yearsThat's definitely the way to go if it's an option, but I've set up scheduled tasks for programs that required their working directory to be set to the program's directory or some other remote location, and the working directory can't be a UNC path.
-
user3165438 over 9 years@EvanAnderson, Why a server is different from regular PC in this issue? Thanks.
-
user3165438 over 9 years@JohnyD, How can I access particular path in case there is no logged-in user? Thanks.
-
Spence over 9 years@user3165438 - It's hard to remember what frame-of-mind I was in 5 years ago when I answered this question, but I suspect I was referring to this: support2.microsoft.com/kb/867466