««Schedule using`At`command in Windows 7

{lang: 'ar'}

The ‘At’ command in Windows 7 allows you to schedule any program or script to run at a specified time. You can schedule the program to run on specified days of the week at the specified time. This works with the Scheduling service and hence the Schedule service must be running to use the ‘At’ command.  This article is for Windows 7. Click here for Windows XP steps

Setting Up At command

  • Open Service panel and ensure ‘Task Scheduler’ service is running. If not, start the ‘Task Scheduler.
  • To verify Task Scheduler, go to Start – Control Panel – System and Security – Administrative Tools – Services. If the Task Scheduler is not running, Start it. Then,
  • Select Start and enter cmd in the Search programs and files box.

  • cmd will be listed under Programs. Right-click and select Run as administrator.

at command has to be Run as administrator. If you attempt to do a schedule a program without administrator privilege, Windows 7 gives an  ”Access Denied” error when the ‘at’ command options are entered at the cmd prompt.

  • Enter parameters to schedule a program. In the below mentioned example, running the Disk Clean utility every day of the week (Mon thru Fri at 9:05 P.M) is shown. Enter the following at the command prompt:

at 11:45 /every:M,T,W,Th,F “cleanmgr.exe”

C:windowssystem32>at 21:05 /every:M,T,W,Th,F “cleanmgr.exe”
Added a new job with job ID = 2 

C:windowssystem32>

  • In the above box, 21:05 represents the time program is run, every:date runs the job on specified day(s). If this parameter is omitted, the job is run at the current day of the month.
  • Enter at /? at the command prompt to get a list of arguments for the ‘At’ command
C:windowssystem32>at /?
The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command. 

AT [\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] “command”

\computername     Specifies a remote computer. Commands are scheduled on t
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.
/next:date[,...]   Runs the specified command on the next occurrence of the
day (for example, next Thursday).  If date is omitted, t
current day of the month is assumed.
“command”          Is the Windows NT command, or batch program to be run.

C:windowssystem32>

Running Programs Interactively

If interactive tasks are required, use schtasks,exe as due to security enhancements Windows 7 does not run the program in interactive mode
C:windowssystem32>at 21:18 /interactive /every:M,T,W,Th,F “cleanmgr.exe”
Warning: Due to security enhancements, this task will run at the time
expected but not interactively.
Use schtasks.exe utility if interactive task is required (‘schtasks /?’
for details).
Added a new job with job ID = 4

C:windowssystem32>

View Scheduled Programs

Enter at to view the scheduled programs as shown below.

C:windowssystem32>at
Status ID   Day                     Time          Command Line
—————————————————————-
2   Each M T W Th F         9:05 PM       cleanmgr.exe
3   Each M T W Th F         9:08 PM       cleanmgr.exe

Deleting Schedule

Enter <id> /delete to delete schedule relating to the specified id. If id is omitted, it deletes all the scheduled programs.

C:windowssystem32>at 2 /delete 

C:windowssystem32>at
Status ID   Day                     Time          Command Line
—————————————————————–
3   Each M T W Th F         9:08 PM       cleanmgr.exe

C:windowssystem32>

Related posts:

  1. Windows 7 Task Scheduler
  2. Disk cleanup utility in Windows 7
  3. Windows 7 – Shutdown and Restart Shortcut

Trackbacks

  1. [...] running to use the ‘At’ command. This article is for Windows XP. For Windows 7, click here Setting Up At commandOpen Service panel and ensure ‘Task Scheduler’ service is [...]

Speak Your Mind

*

Page optimized by WP Minify WordPress Plugin