Going forward codeinspections will also be covering topics which we be useful for techies in their day to day jobs and this is first post in this series. Today we will learn how to schedule a job in windows. Linux guys will be aware of scheduling the jobs using cron there is similar way to schedule job in windows as well. Scheduling job is very important task especially for testers, testers need to schedule their auotmated test execution.
Windows jobs can be scheduled either from command prompt or from the UI. Below we mention ways to do it:
Using UI:
Using Command Prompt: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