At (Windows)
Encyclopedia
at is a command
Command (computing)
In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell....

 which schedules
Job scheduler
A job scheduler is a software application that is in charge of unattended background executions, commonly known for historical reasons as batch processing....

 other commands to be run at a certain time. It may run a command once, or repeatedly based upon the day of the week, or the date
Calendar date
A date in a calendar is a reference to a particular day represented within a calendar system. The calendar date allows the specific day to be identified. The number of days between two dates may be calculated. For example, "24 " is ten days after "14 " in the Gregorian calendar. The date of a...

. It is available on all Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

-based operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s.

Each command is given a job number or "task ID", starting at 1. All unfinished or repeating jobs are reloaded at boot
Booting
In computing, booting is a process that begins when a user turns on a computer system and prepares the computer to perform its normal operations. On modern computers, this typically involves loading and starting an operating system. The boot sequence is the initial set of operations that the...

 time, though not necessarily with the same job numbers. When there are no jobs left, the next job added is assigned 1 again; otherwise, all previously-assigned job numbers are skipped (even if the most recent has been deleted).

Scheduled tasks are not run if the computer is turned off at the time, or is in sleep mode
Sleep mode
Sleep mode refers to a low power mode for electronic devices such as computers, televisions, and remote controlled devices. These modes save significant electrical consumption compared to leaving a device fully on and idle, but allow the user to avoid having to reset programming codes or wait for a...

 or hibernate mode. The "Task Scheduler" service (Schedule) must also be running.

Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s also have at
At (Unix)
In Unix-like computer operating systems,the at commandis used to schedule commands to be executed once, at a particular time in the future....

, but the Windows version is functionally more similar to cron
Cron
Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs to run periodically at certain times or dates...

.

Usage

By itself, at gives a list of all pending jobs. By supplying a task ID, slightly more details of the task are displayed.

To shut down
Shutdown (computing)
To shut down or power off a computer is to remove power from a computer's main components in a controlled way. After a computer is shut down, main components such as CPUs, RAM modules and hard disk drives are powered down, although some internal components, such as an internal clock, may retain...

 a computer
Personal computer
A personal computer is any general-purpose computer whose size, capabilities, and original sales price make it useful for individuals, and which is intended to be operated directly by an end-user with no intervening computer operator...

 at 10:00 in the evening:
at 10p shutdown -s
The above example will cause shutdown.exe to shut down the computer the next time the computer's clock reads 10pm. Synonyms for this time are 10:00p or 22:00; however 10 or 22 will not work. (Note that shutdown.exe is in one of the folders (normally C:\Windows\System32) listed in the %PATH%
Path (variable)
PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located...

 environment variable
Environment variable
Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.They can be said in some sense to create the operating environment in which a process runs...

. Other commands will require the full file path.)

Commands can also be scheduled on other computers on a local-area network, using a remote procedure call
Remote procedure call
In computer science, a remote procedure call is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space without the programmer explicitly coding the details for this remote interaction...

 (RPC). However, the user must be an administrator, have permission on the other machine, and the user account on both machines must have a password
Password
A password is a secret word or string of characters that is used for authentication, to prove identity or gain access to a resource . The password should be kept secret from those not allowed access....

 (RPC will refuse if passwords are blank). The UNC computer name is placed immediately after at in order to do this, as follows:
at \\otherdesk 10p shutdown -s
The shutdown command is then scheduled on the remote computer named "otherdesk" (not locally), and will show in its list of jobs. A remote computer's jobs can also be checked as follows:
at \\otherdesk

Flags

Several flag
Flag (computing)
In computer programming, flag can refer to one or more bits that are used to store a binary value or code that has an assigned meaning, but can refer to uses of other data types...

s greatly expand the usefulness of at, allowing it to act similarly to cron. All flags come before the command being scheduled.

The /every: flag can be used to repeat a command at the same time, by using a date of the month, or abbreviations for the days of the week: m, t, w, th, f, s, su. Standard two- and three-letter abbreviations (except th and su) will cause the at command to fail, however the full names of the days can also be used. If no day or date is given, the current date is assumed.

at 10p /every:m,t,w,th,f shutdown -s
at 7p /every:s,su shutdown -s
The above commands will shut down the computer at 10:00 (22:00) every weekday
Weekday
Weekday may either refer to only a day of the week which is part of the workweek thus not part of the weekend or to any of the days of the week.-Weekday as a day of the workweek:In most countries the days of the workweek are:# Monday# Tuesday# Wednesday...

 evening, and at 7:00 (19:00) every weekend
Workweek
The workweek and weekend are those complementary parts of the week devoted to labour and rest respectively. The legal working week , or workweek , is the part of the seven-day week devoted to labor. In most Western countries it is Monday to Friday. The weekend comprises the two traditionally...

 evening.

Similarly, the /next flag runs the commands only on the first occurrence of each of the days or dates supplied. If either flag is used to schedule something on a date that does not exist in a given month (such as February 30), it will be skipped until the next month (in this case, March 30).

The /delete or /d flag will delete a job if its number is given, or all jobs if none is given. When used with it, the /yes or /y flag will do so without asking for confirmation.

The /interactive or /i flag will allow the command to interact with the user who is logged-on when the job runs, for example, to warn of a shutdown or to allow the user to cancel it.

Replacement

In Windows XP, the schtasks
Schtasks
schtasks is a command which schedules other commands to be run at a certain time. It may run a command once, or repeatedly based upon the day of the week, or the date...

command is much more powerful and flexible, but also much more complex. The Task Scheduler
Task Scheduler
Task Scheduler is a component of Microsoft Windows that provides the ability to schedule the launch of programs or scripts at pre-defined times or after specified time intervals. It was first introduced in the Windows 95 Plus! pack as System Agent but was renamed to Task Scheduler in Windows 98...

 is the graphical user interface
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...

to schtasks, and at jobs will show in the task lists of both programs.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK