
Windows jobs can be scheduled either from command prompt or from the UI. Below we mention ways to do it:
Using UI:
- Click Start> All Programs > Accessories > System Tasks > Scheduled tasks
- Right Click and create new task and give some name
- Right Click and click on properties
- Add any command say "cmd /c dir > c:\test.out"
- We can set the schedule from the schedule tab
- We can set the user under which to run this task
- Go to command prompt (Click on Start>Run and enter cmd)
- Use the AT command to schedule the job
- By default all command line tasks will run under System by default
- AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]] (to delete the task) AT [\\computername] time [/INTERACTIVE][ /EVERY:date[,...] | /NEXT:date[,...]] "command"
\\computername Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.
id Is an identification number assigned to a scheduled
command.
/delete Cancels a scheduled command. If id is omitted, all the
scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further
confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the user
who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week or
month. If date is omitted, the current day of the month
is assumed.
No comments:
Post a Comment