Windows at command status error

at at

Область применения: Windows Server (половина ежегодного канала), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

Планирует выполнение команд и программ на компьютере в указанное время и дату. Schedules commands and programs to run on a computer at a specified time and date. Можно использовать только в том случае, если запущена служба расписания. You can use at only when the Schedule service is running. При использовании без параметров в выводится список запланированных команд. Used without parameters, at lists scheduled commands. Для выполнения этой команды необходимо быть членом локальной группы администраторов. You must be a member of the local Administrators group to run this command.

Синтаксис Syntax

Параметры Parameters

Параметр Parameter Описание Description
\ Указывает удаленный компьютер. Specifies a remote computer. Если этот параметр не указан, по расписанию команды и программы на локальном компьютере. If you omit this parameter, at schedules the commands and programs on the local computer.
Указывает идентификационный номер, назначенный команде по расписанию. Specifies the identification number assigned to a scheduled command.
/delete /delete Отменяет запланированную команду. Cancels a scheduled command. Если опустить идентификатор, все запланированные команды на компьютере будут отменены. If you omit ID, all of the scheduled commands on the computer are canceled.
/ес /yes Отвечает Да для всех запросов из системы при удалении запланированных событий. Answers yes to all queries from the system when you delete scheduled events.
Указывает время выполнения команды. Specifies the time when you want to run the command. время выражается в виде часов: минут в 24-часовом формате (00:00 (полночь) до 23:59). time is expressed as Hours:Minutes in 24-hour notation (that is, 00:00 (midnight) through 23:59).
интерактивный interactive Позволяет команде взаимодействовать с рабочим столом пользователя, выполнившего вход во время выполнения команды . Allows command to interact with the desktop of the user who is logged on at the time Command runs.
неделю every: Выполняет команду в каждый указанный день или дни недели или месяца (например, каждый четверг или третий день каждого месяца). Runs command on every specified day or days of the week or month (for example, every Thursday, or the third day of every month).
Указывает дату выполнения команды. Specifies the date when you want to run the command. Можно указать один или несколько дней недели (то есть введите M,T,W,th,F,S,SU) или один или несколько дней месяца (то есть введите от 1 до 31). You can specify one or more days of the week (that is, type M,T,W,Th,F,S,Su) or one or more days of the month (that is, type 1 through 31). Несколько записей дат разделяются запятыми. Separate multiple date entries with commas. Если опустить дату, в используется текущий день месяца. If you omit date, at uses the current day of the month.
очеред next: Выполняет команду при следующем возникновении дня (например, в следующем четверг). Runs command on the next occurrence of the day (for example, next Thursday).
Указывает команду Windows, программу (т. е. exe-или COM-файл) или пакетную программу (файл. bat или. cmd), которую требуется выполнить. Specifies the Windows command, program (that is, .exe or .com file), or batch program (that is, .bat or .cmd file) that you want to run. Если команде требуется путь в качестве аргумента, используйте абсолютный путь (то есть весь путь, начинающийся с буквы диска). When the command requires a path as an argument, use the absolute path (that is, the entire path beginning with the drive letter). Если команда находится на удаленном компьютере, укажите для имени сервера и общего ресурса нотацию UNC, а не букву удаленного диска. If the command is on a remote computer, specify Universal Naming Convention (UNC) notation for the server and share name, rather than a remote drive letter.
/? /? Отображение справки в командной строке. Displays help at the command prompt.

Комментарии Remarks

Эта команда не загружает cmd.exe автоматически перед выполнением команд. This command doesn’t automatically load cmd.exe before running commands. Если исполняемый файл (exe) не используется, необходимо явно загрузить cmd.exe в начале команды следующим образом: If you’re not running an executable (.exe) file, you must explicitly load cmd.exe at the beginning of the command as follows:

При использовании этой команды без параметров командной строки запланированные задачи отображаются в таблице, отформатированной следующим образом: If using this command without command-line options, scheduled tasks appear in a table formatted similar to the following:

Если включить идентификационный номер (ID) с этой командой, только сведения для одной записи отображаются в формате, аналогичном следующему: If including an identification number (ID) with this command, only information for a single entry appears in a format similar to the following:

После планирования команды, особенно команды с параметрами командной строки, проверьте правильность синтаксиса команды , введя команду без параметров командной строки . After you schedule a command, especially a command that has command-line options, check that the command syntax is correct by typing at without any command-line options. Если сведения в столбце командной строки неверны, удалите команду и введите ее снова. If the information in the Command Line column is wrong, delete the command and retype it. Если она по-прежнему неверна, повторно введите команду, используя меньше параметров командной строки. If it’s still incorrect, retype the command using fewer command-line options.

Команды, запланированные в при запуске как фоновые процессы. Commands scheduled with at run as background processes. Выходные данные не отображаются на экране компьютера. Output is not displayed on the computer screen. Чтобы перенаправить вывод в файл, используйте символ перенаправления > . To redirect output to a file, use the redirection symbol > . При перенаправлении выходных данных в файл необходимо использовать escape-символ ^ перед символом перенаправления, независимо от того, используется ли в командной строке или в пакетном файле. If you redirect output to a file, you need to use the escape symbol ^ before the redirection symbol, whether you are using at at the command line or in a batch file. Например, чтобы перенаправить вывод в output.txt, введите: For example, to redirect output to output.txt, type:

Текущим каталогом для выполняемой команды является папка SystemRoot. The current directory for the executing command is the systemroot folder.

Если изменить системное время после того, как вы запланируете выполнение команды, синхронизируйте планировщик at с измененным системным временем , введя параметр без параметров командной строки. If you change the system time after you schedule a command to run, synchronize the at scheduler with the revised system time by typing at without command-line options.

Запланированные команды хранятся в реестре. Scheduled commands are stored in the registry. В результате вы не потеряли запланированные задачи при перезапуске службы расписания. As a result, you don’t lose scheduled tasks if you restart the Schedule service.

Не используйте перенаправленный диск для запланированных заданий, обращающихся к сети. Do not use a redirected drive for scheduled jobs that access the network. Возможно, служба расписания не может получить доступ к перенаправленному диску, или перенаправленный диск может отсутствовать, если во время выполнения запланированной задачи в системе вошел другой пользователь. The Schedule service might not be able to access the redirected drive, or the redirected drive might not be present if a different user is logged on at the time the scheduled task runs. Вместо этого используйте UNC-пути для запланированных заданий. Instead, use UNC paths for scheduled jobs. Пример. For example:

Не используйте следующий синтаксис, где x: — это соединение, устанавливаемое пользователем: Do not use the following syntax, where x: is a connection made by the user:

Если вы запланируете команду at , которая использует букву диска для подключения к общему каталогу, включите команду at , чтобы отключить диск по завершении работы с диском. If you schedule an at command that uses a drive letter to connect to a shared directory, include an at command to disconnect the drive when you are finished using the drive. Если диск не отключен, назначенная буква диска не будет доступна в командной строке. If the drive is not disconnected, the assigned drive letter won’t be available at the command prompt.

По умолчанию задачи, запланированные с помощью этой команды, будут прекращаться через 72 часов. By default, tasks scheduled using this command will stop after 72 hours. Можно изменить реестр, чтобы изменить это значение по умолчанию. You can modify the registry to change this default value.

Изменение реестра To modify the registry

Неправильное изменение реестра может серьезно повредить систему. Incorrectly editing the registry may severely damage your system. Перед внесением изменений следует сделать резервную копию всех ценных данных на компьютере. Before making changes to the registry, you should back up any valued data on the computer.

Запустите редактор реестра (regedit.exe). Start the registry editor (regedit.exe).

В реестре выберите и щелкните следующий раздел: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule Locate and click the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule

В меню Правка выберите команду Добавить значение, а затем добавьте следующие значения реестра: On the Edit menu, click Add Value, and then add the following registry values:

Имя значения. Value Name. аттаскмаксхаурс atTaskMaxHours

Тип данных. Data type. reg_DWOrd reg_DWOrd

Основание системы счисления. Radix. Decimal Decimal

Данные значения: 0,0. Value Data: 0. Значение 0 в поле данных значения указывает на отсутствие ограничения и не останавливается. A value of 0 in the Value Data field indicates no limit and doesn’t not stop. Значения от 1 до 99 указывают количество часов. Values from 1 through 99 indicates the number of hours.

Вы можете использовать папку «Назначенные задания» для просмотра или изменения параметров задачи, созданной с помощью этой команды. You can use the Scheduled Tasks folder to view or modify the settings of a task that was created by using this command. При планировании задачи с помощью этой команды задача отображается в папке «Назначенные задания» с именем, указанным ниже:At3478. When you schedule a task using this command, the task is listed in the Scheduled Tasks folder, with a name such as the following:at3478. Однако при изменении задачи в папке «Назначенные задания» она обновляется до обычной запланированной задачи. However, if you modify a task through the Scheduled Tasks folder, it’s upgraded to a normal scheduled task. Задача больше не является видимой для команды at , а параметр учетной записи at больше не применяется. The task is no longer visible to the at command, and the at account setting no longer applies to it. Необходимо явно ввести учетную запись пользователя и пароль для задачи. You must explicitly enter a user account and password for the task.

Примеры Examples

Чтобы отобразить список команд, запланированных на сервере Marketing, введите: To display a list of commands scheduled on the Marketing server, type:

Чтобы получить дополнительные сведения о команде с идентификационным номером 3 на сервере Corp, введите: To learn more about a command with the identification number 3 on the Corp server, type:

Планирование выполнения команды net share на корпоративном сервере 8:00 утра To schedule a net share command to run on the Corp server at 8:00 A.M. и перенаправьте список на сервер обслуживания, в общий каталог Reports и в файл Corp.txt введите: and redirect the listing to the Maintenance server, in the Reports shared directory, and the Corp.txt file, type:

Чтобы создать резервную копию жесткого диска маркетингового сервера на ленточный накопитель каждые пять дней, создайте пакетную программу с именем Archive. cmd, которая содержит команды резервного копирования, а затем запланируйте выполнение пакетной программы, наберите: To back up the hard drive of the Marketing server to a tape drive at midnight every five days, create a batch program called Archive.cmd, which contains the backup commands, and then schedule the batch program to run, type:

Чтобы отменить все команды, запланированные на текущем сервере, очистите сведения о расписании, как показано ниже. To cancel all commands scheduled on the current server, clear the at schedule information as follows:

Чтобы выполнить команду, которая не является исполняемым файлом (exe), перед командой выполните команду с помощью команды cmd/c для загрузки cmd.exe следующим образом: To run a command that is not an executable (.exe) file, precede the command with cmd /c to load cmd.exe as follows:

Дополнительные ссылки Additional References

schtasks. schtasks. Другое средство планирования командной строки. Another command-line scheduling tool.

Windows at command examples

At command, as the name indicates, can be used to schedule applications at specified time and date. This is a built-in command in Windows OS and does not require any separate software to be installed on the computer.

First thing you need to know is that At command requires Task Scheduler service to be running on the system. Otherwise you would get an error like below.

Let’s see few examples on how to use At command.

Schedule a task at a particular time

To schedule a task we just need to specify the time and the command for the task we need to run. For example, if you want to shutdown your computer at 11PM today then you can do this by running the below command.

Schedule a Recurrent Task

We can schedule tasks that run recurrently once in a week or once in a month. We can use /every switch for this purpose. Let’s say you want to automatically run defragmentation on one of the drives once in every week. This can be done by running the below command

After running this command system will initiate defragmentation on C: drive at 10 AM on every Monday.

See the tasks scheduled

We can see the list of scheduled tasks just by running At command without any parameters.

Schedule a task on some other day

We can use /next switch to schedule tasks for a different day. For example to run defragmentation on C: drive on next Thursday you can run the below command.

Schedule tasks to run every day

Using /every switch we can schedule a task to be run every day. For example to shutdown your computer automatically every day at 11PM you can create a task using the below command.

Delete Scheduled Tasks

We can delete scheduled tasks from the database by using /delete switch. We need to pass the id of the task we need to delete. We can see the id for each task by running At command without any parameters. For example to delete the task with the id 1 we need to run the below command.

I’m not sure if it’s related to the topic but I’ll ask anyway.
I need to get the exact location of a process name that a scheduled job is executing. I want to use WMIC JOB (if you have any other suggestions.. let me know) to get that, but I don’t know HOW exactly. I’ve tried several variations but no luck so far.
How should I do that?
I thought of direction like-
wmic job where name=”at2″ get command /value
but no luck.
Thanks in advance.

If it’s not the place to ask, tell me where can I ask.

BTW thanks for the article 🙂

I have tried this wmic command. It seems to be showing the jobs that are scheduled using at command. For the ones scheduled using the GUI task scheduler, it’s not showing any data and displays the message ‘No instance(s) available’.

You can try this command to get the command information.

wmic job where jobid=id get command

I have observed that name field is empty for the jobs scheduled using ‘at’. So you better use the job id. Or running ‘wmic job get command’ will show the commands for all the jobs currently running.

Why jobid=2? How can you be sure?
I want to know the command of a specific job that is not nessecerily running RIGHT NOW. I need it to check for every job exists.

wmic job get command shows “No Instance(s) Available”.
Same at “wmic job where jobid=2 get command”.

Thanks.
BTW Is that a new site running?

I have used 2 just as an example, you need to use the id of your job.
if you want to get it for every job, as I mentioned earlier, run the below command.
wmic job get command

Note that you need to run this from elevated administrator command prompt. otherwise you may get ‘no instance(s) available’ message.

How can I know the jobid? Problem is that I can’t know it (or am I wrong?).
The only thing I can know is the job’s name (‘at2’ for example). The WMIC JOB command need to be based on that.

I’ve tried as administrator (although UAC is disabled), same =\

wmic job shows the jobs that are running at that time.
you can get the job list using at command.

Oh.. so you mean I can forget about WMIC for what I need?

I’ve tried typing only ‘at’ command, all I got is “There are no entries in the list”, while I do have one (named at3). Even if I’ll manage to see the list, is there a way to get somehow only the command itself? (the process name)

I’d be glad for some answers 🙂
Thanks.

My previous replies have the answers.
First use at command to get the job id. If at command doesn’t show it, get it from scheduled tasks UI
Then use the below command.
wmic job where jobid=id get command
As mentioned earlier, this command will work only if the scheduled job is running at that time.

Ha! I got it finally.
Somewhy I haven’t pay attention to what you said earlier “It (WMIC command) seems to be showing the jobs that are scheduled using at command”.
Now I can be 100% sure I won’t need it unfortunately.

Thank you! 🙂
I guess I won’t bother you again with dumb questions… 😛

how would you make it run on log in
kinda’ like:
at login /every:M,T,W,TH,F,SA,SU start iexplore.exe (or any .exe/.bat)

I used the AT command on my Windows 7 OS but it is giving me “access denied” error message.

Run it from elevated administrator command prompt.

disable UAC and should work

Is it possible when running the “AT” command, to add a job name? As in – whenever the scheduled task is created, it creates the task with a job name of “At1” or “At2”, etc. Is there a way to specify what the scheduled task might be called?
– Chris

This is very late, but for the benefit of others having the same question, ‘At’ command does not provide a way to tag the command with a specific id. When we schedule a new task, it automatically tags them with ids like’at1′, ‘at2’, ‘at3’ and so.

Unfortunately this command seems to be deprecated in W10, replaced with some ugly schtasks or something, too bad I really liked the syntax of this one,

How to delete AT1 ,at1 ,at3,at4 .. etc… with command line and leave other windows task running

I tried with schtasks /delete /tn * /F then my all windows task got deleted , I want only AT tasks needs to deleted

Читайте также:  Acer aspire 3690 linux
Оцените статью