0

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!

4 Answers 4

5

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.

3
  • Also make sure you haven't checked the "run only if logged on" option ;)
    – Simon
    Jun 18, 2009 at 13:15
  • @EvanAnderson, Why a server is different from regular PC in this issue? Thanks. Oct 6, 2014 at 10:26
  • @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 Oct 6, 2014 at 17:49
3

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.

4
  • 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. Jun 18, 2009 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, 2009 at 15:38
  • BTW Evan, that's a good solution that I will most likely employ in the future. Thanks!
    – JohnyD
    Jun 19, 2009 at 15:39
  • @JohnyD, How can I access particular path in case there is no logged-in user? Thanks. Oct 6, 2014 at 10:27
1

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.

1

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.

1
  • 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, 2010 at 19:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .