XP Pro: Schedule a program to run once at a specific time using schtasks
Windows XP Professional has a command line utility that allows users to schedule the execution of tasks. The schtasks utility has a wide variety of options. This recipe provides a simple example of scheduling a task to run once in the future.
The minimum parameters required to run a task once are /sc (schedule), /tr (task to run), /st (start time), and /tn (unique task name). This syntax will run the task as the current user. To run the defrag program on the C: drive at 11 PM, use this command:
The schedule (/sc once) indicates that the task will only be executed once. The start time (/st 23:00:00) determines the time (HH:MM:SS) that the task will start in the 24 hour format. The task name (/th cdefrag) must be a unique name that can be used to reference the scheduled task later. The task to run (/tr "defrag c:") specifies the command and parameters to run. Enclosing the task to run in quotes is required for tasks with options.
When you run the command above, it will tell you the user the task will run under (the current user) and will prompt for that user's password. It is possible to place the password in the command (using /rp password) although to do so may be a security risk -- use at your own risk.
If you want to run the task as another user, specify the username with the /ru username command option.
By default, the task will execute within the next 24 hours at the next occurance of the start time. To run the command at the speficied time on a different date, use the /sd mm/dd/yyyy option.
To view the scheduled events, just run schtasks with no options.
Also see ...
H3If a long path is frequently accessed, assigning it to a spare drive letter can save time. This recipe describes assigning a drive letter to a local drive path from the command line. /H3PThe span style="font weight: bold"subst/span command allows the substitution of a drive letter for
H3Make all your folders look the same/H3PIf you are tired of setting each folder to your favorite view style (such as thumbnails or tiles), you may change your default folder view. br / br /1. Go into a folder a set it up the way you like br /2. Select Tools Folder Options
H3As the worms are coming out faster and faster after security exploits are found, the automatic update is being reconsidered by a lot of users. This explains how to change your automatic update settings./H3PPreviously a lot of users turned off windows span style="font weight: bold"Automati
H3View all connections and listening ports/H3PSeveral win programs allow one to see who is connected to the local machine. However, there is a dos based command that works just as well. br / br /netstat br / br /Sample output: br /blockquote br / br /Active Conne
H3This explains how to install an INF file from the command line./H3PSetup information files have the *.inf extension and are often used to install registry settings and device drivers. To manually install an INF file, the user can right click and select span style="font weight: bold"instal
