Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I set a new scheduled task to start "when my computer starts". I assigned an Administrator user to run the task. This is an executable that is supposed to run indefinitely in the background.

The problem is, that if the Administrator logs in and then logs off, the task stops running.

Is there a solution for this?

UPDATE: this was caused because the task running was in java. See my own solution.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

This happened because the task running was a java application. Java intercepts user logoff events and stops execution. This is solved by adding -Xrs to the command line running the application, causing the JVM to ignore the logoff event.

share|improve this answer
    
Glad you figured it out. Make sure to mark your own answer as accepted so people know the question has been solved ;) –  nhinkle Jul 19 '10 at 17:48

What does the program do, and what level of access does it use? You might be better off running the task from one of the Service user accounts (LocalService, NetworkService or LocalSystem). This will cause the task to run under a system account which does not interact with the desktop, and does not load a regular user's profile. It also means it won't be affected by users logging on and off, since these accounts are perpetually "logged on". Just be careful: the LocalSystem account in particular has essentially complete system access, meaning that if whatever your task is running were to somehow become accessible to a user, they could potentially gain full access to the system.

share|improve this answer
    
thanks, I'll try that now. –  Ovesh Feb 18 '10 at 7:21
    
I can't assign any of the users you suggested. From what I see in the documentation you referenced, these users are intended for use with services (service control manager), which as far as I know, is not Scheduled Tasks. Please correct me if I'm wrong. I also forgot to mention, I'm on Windows 2003. –  Ovesh Feb 18 '10 at 7:40
    
Ah, I'm sorry. I'm used to the revamped task scheduler in Server 2008 and Windows 7, where you can select it to run as one of the system accounts. I just booted up an XP VM and checked, and you are correct, it doesn't appear possible to do in older versions of windows. Sorry for overlooking that. –  nhinkle Feb 19 '10 at 8:09

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.