Let's start by looking at what a scheduled task is. A scheduled task is an application or tool set to run at specified daily, weekly, monthly or even on a specific day of the month or week. These tasks also run with system account credentials to accomplish a task that a non administrative account doesn't have rights to accomplish. Knowing how to set these tasks by command line allows an administrator write scripts to add these tasks to many machines easily without having to set the task on each individual PC individually.
Introduction to the "at" command. Scheduling tasks through the command line, either locally or remotely, depends on an understanding of the "at" command. The command is quite literal once you know its meaning, let's look at an example "at" command:
C:\> at 4:00 defrag.exe
If you look in your local task scheduler you'll see this automatically created a task to run the defragment tool the next time 4am comes around. Let's break it down [bracketed terms are implied by the syntax],
at 4:00
This runs the task a single time. It also creates and runs the task as "System". So, how do you get that same command to create a task on a remote machine? Let's take a look:
C:\>at \\Name 4:00 defrag.exe
This creates the exact same task on a remote machine as it created on your local machine. It also creates and runs the task using the system account just like the locally created one. One note: the account you are using when you run this command must have administrative rights to the remote system, otherwise the command will fail with an error. The remote system also needs to have "File and Print Sharing" enabled, though this is enabled by default when you join a PC to a domain. The At command runs on 24-hour time, so 1am would be 1:00 but 1pm would be 13:00.
This should give you a basic understanding of how to schedule tasks from the command-line.
Published by Mark Schneider
Technology Director, Technical Consultant, Network Engineer, Server Engineer, Software Developer, Online Game Addict. Try everything, you never know what you'll be good at. View profile
- Listing and Killing Processes from the Windows Command Line: Stupid Admin Tricks #2A brief summary outlining how to use the tasklist and taskkill utilities.
- Ten Useful Windows Native Command Line UtilitiesTen utilities that every Windows administrator should know.
Coming Soon: Microsoft Home ServerMicrosoft has decided to pair their new software MS Home Server with Hewlett-Packard. According to sources, the new MS Home Server will make its debut sometime in the second ha...- 29 Questions Nonprofits Should Ask when Evaluating Scheduling Calendar Software3 major issues for nonprofits considering new scheduling calendar software are affordability, ease-of-use and adaptability. These 29 questions gets you needed answers for buying this type of nonproft software
Learn More About Microsoft Office 2007; Download the Free TrialIn this article you will learn how to experience the free trial of Microsoft Office 2007.
- Walter Reed General Relieved of Command
- Windows XP Service Pack 2
- Online Video Claims Rudy Giuliani Lied About Command Center at WTC
- Command and Conquer 3 Tiberium Wars
- Employee Empowerment: Allowing Employees To Take on Independent Tasks
- Scheduling Employees Effectively for Small Businesses
- Basic Uses of the WMI (Windows Management Instrumentation) Command Line for Admini...





1 Comments
Post a CommentLooks as though the literal translation got eaten somewhere along the line. Should read like the following:
AT 4:00(am) (run)defrag.exe
you can also delete a scheduled task using the following syntax:
at \pcname 1 /delete
The number 1 denotes the task ID as seen in the task schedule