1

i just scheduled a hibernate command:

at 13:00 shutdown /h

Is there any command to abort this scheduled operation?

  1. shutdown /a didn't work, it said there is no scheduled shutdown.

  2. At 12:59 shutdown /a didn't work as well for aborting At 13:00 shutdown /h

  • Type schtasks /? and take it from there. – AFH Apr 16 '16 at 14:32
  • @afh at {id} /delete is much simpler ;) – DavidPostill Apr 16 '16 at 14:33
  • @DavidPostill - OK. Win10 tells me that at is deprecated and to use schtasks instead. – AFH Apr 16 '16 at 14:35
  • @AFH Yes "The AT command has been deprecated and is no longer available In Windows 8." so the OP must have Windows 7 or earlier ;) – DavidPostill Apr 16 '16 at 14:38
  • @AFH And if you want delete with schtasks you have to know the taskname create from the at command, which will be At{id} ... – DavidPostill Apr 16 '16 at 14:43
0

Shutdown /a will only work after the shutdown has been schedule using the command

So wait for the shutdown event to trigger and then run shutdown /a

so if you run this at 13.01 it would work

|improve this answer|||||
  • at {id} /delete is much simpler ;) – DavidPostill Apr 16 '16 at 14:33
  • It's a matter of choice I have backup scheduled daily at 5pm on my servers and then I shutdown using this command but if I am still working I just use shutdown /a to cancel it – SeanClt Apr 16 '16 at 14:35
0

Is there any command to abort this scheduled operation?

at 13:00 shutdown /h

You can run at by itself to list the scheduled jobs. Example:

F:\test>at 13:00 echo "hello"
Added a new job with job ID = 1

F:\test>at
Status ID   Day                     Time          Command Line
---------------------------------------------------------------------
        1   Tomorrow                13:00         echo hello

This returns a list of scheduled jobs, together with an ID for each job.

To delete a scheduled job:

at ID /delete

Example:

F:\test>at 13:00 echo "hello"
Added a new job with job ID = 1

F:\test>at
Status ID   Day                     Time          Command Line
-------------------------------------------------------------------------------
        1   Tomorrow                13:00         echo hello

F:\test>at 1 /delete

F:\test>at
There are no entries in the list.

To delete a scheduled job using schtasks:

schtasks /delete /tn At{ID}

Where {ID} is the ID of the at task.

Example:

F:\test>schtasks /delete /tn At1
WARNING: Are you sure you want to remove the task "At1" (Y/N)? y
SUCCESS: The scheduled task "At1" was successfully deleted. 

To delete all scheduled jobs:

at /delete /yes

at usage

F:\test>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 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.
/next:date[,...]   Runs the specified command on the next occurrence of the
                   day (for example, next Thursday).  If date is omitted, the
                   current day of the month is assumed.
"command"          Is the Windows NT command, or batch program to be run.

Further Reading

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.