Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

4 Answers 4

up vote 5 down vote accepted

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.

share|improve this answer
    
Also make sure you haven't checked the "run only if logged on" option ;) –  Simon Jun 18 '09 at 13:15

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.

share|improve this answer
    
Good 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. –  Evan Anderson Jun 18 '09 at 17:06
    
And 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 Jun 19 '09 at 15:38
    
BTW Evan, that's a good solution that I will most likely employ in the future. Thanks! –  JohnyD Jun 19 '09 at 15:39

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.

share|improve this answer

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.

share|improve this answer
    
That'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. –  Josh Jul 30 '10 at 19:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.