Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


January 2002

Scheduled Tasks Follow-Up

RSS
Subscribe to Windows IT Pro | See More Windows 2000 Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Since my Reader to Reader article in June 2001 ("A Scheduled Tasks Tutorial"), many people have emailed me for help. I decided to follow up with an explanation of how to schedule a task and verify that the task has run, even when you're logged on as another user.

The Scheduled Task Wizard is one of Windows' most ambiguous features. The wizard evolved from the At command, and most of the procedure and documentation remained the same. The most confusing thing about the Scheduled Task Wizard is the message Enter the name and password of a user. The task will run as if that user started it. Windows 98's version of the Task Scheduler service doesn't include this message because Win98 doesn't use the At command. The At service is available only on Windows 2000 and Windows NT.

Microsoft explains the Scheduled Task Wizard in several articles. The article "How to Schedule a Program Using Task Scheduler" (http://support.microsoft.com/support/kb/articles/q178/7/06.asp) states, "To use Task Scheduler, you must log on to the computer with a valid user account." The article "Task Scheduler Service on Windows NT" (http://support.microsoft.com/support/kb/articles/q235/5/36.asp) says, "The 'logon as' field is not available for the Task Scheduler service. These credentials do not need to be configured for the Task Scheduler service because each individual task can be configured with unique credentials for the privileges required." Finally, the article "HOW TO: Schedule a Server Process in Windows 2000" (http://support.microsoft.com/support/kb/articles/q300/1/60.asp) gives a good explanation: "By default, Task Scheduler logs on as the Local System account. In some cases, this account may not have the appropriate permissions to perform the scheduled task. Because of this, you must specify an account in the Scheduled Task Wizard. Verify that the account you specify in the wizard has sufficient rights to perform the task you are scheduling by logging on as that user and running the task manually."

I've never succeeded in running a scheduled task unless I used the same username and password to schedule the task as I used when I logged on to the machine. However, you can log on with one username and password, schedule a task, log off, then log on again as another user. Your task will run at the time you specified and will appear in the log as running. But if the task requires interaction with the desktop, you won't see the task run.

To test this procedure, write a batch file that creates a directory. For example, open Microsoft Notepad and enter

c: 
cd\ 
md test 

Save the file as md.bat. Log on as an administrator or under an account that has administrative privileges. Using the same username and password, schedule md.bat to run in 5 minutes. Then, log off and log on again under another username. Start Windows Explorer, and wait for the test folder to appear in the C drive. If the folder appears, you scheduled the task correctly when you were logged on as an administrator. Your task will run in the background because it doesn't interact with the desktop. The task will appear in the Scheduled Tasks log, although the Task Scheduler might not show the task under the username you used. Whether the Task Scheduler shows the task under all usernames depends on how the Task Scheduler service is configured in Administrative Tools. The Task Scheduler service depends on the remote procedure call (RPC) service. The test folder also provides verification that the task ran.

For additional information about scheduling tasks, see Dick Lewis, Scripting Solutions: "Making a Script Work as a Scheduled Task," June 2001, and Kathy Ivens and Kenton Gardinier, "Win2K Task Scheduler," January 2001. Also, see the Microsoft articles "Task Scheduler Service Must Be Started with System Account" (http://support.microsoft.com/support/kb/articles/q223/1/70.asp) and "Troubleshooting AT Command Using /k Switch" (http://support.microsoft.com/support/kb/articles/q142/0/40.asp).

End of Article



Reader Comments
I wrote a simple batch file to run a URL that triggers a radio station to run in Media Player. But whatever I try to get Scheduled Task to execute it fails. Including from Administrator with all the correct PW settings etc.

It really drives me crazy not being able to get such a simple function to work.

Any help will be utterly appreciated.

Ryan June 05, 2004


My scheduled tasks say "could not start". I have tried many things. I have windows xp home edition. Can anyone help. I'm so frustrated.

Anonymous User February 22, 2005


The standard log for scheduler is "SchedLgU.Txt" (in win2k, I'm not sure about XP, but it is probably the same). Using the log file should give you a much more detailed description of the problem with your schedule.
-Gideon.

Anonymous User August 23, 2005 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Confirmed: Battery Life Issues Not Windows 7's Fault

Microsoft on Monday issued a lengthy statement about the recent Windows 7 battery controversy, echoing my assessment from earlier in the day, but backing it up with hard, cold evidence. ...

Battery Life Issues Almost Certainly Not Windows 7's Fault

While Microsoft is still investigating a notebook battery life issue that was supposedly caused by Windows 7, some interesting trends have emerged. ...

Microsoft Warns of Windows Version Expirations

Microsoft warned that this year will see three out-of-date Windows versions slip into retirement. ...


Windows OSs Whitepapers Protecting Microsoft SharePoint

Related Events Are your IT systems distributed? Or convoluted?

Deep Dive into Windows Server 2008 R2 presented by John Savill

7 Ways To Get More From Your SharePoint Deployment Now

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2010 Penton Media, Inc. Terms of Use | Privacy Statement