Avoid "system will shut down in 10 minutes" using shutdown on windows

6

3

Is it possible to avoid the message that displays that the system will shut down in ten minutes if using the following command?

shutdown -s -t 3600

The Wavelength

Posted 2013-03-02T08:49:21.883

Reputation: 449

Answers

1

You can easily do that by changing the comment to space:

shutdown -s -t 3600 -c " "

The warning message will be skipped because there is no message.

guy shefer

Posted 2013-03-02T08:49:21.883

Reputation: 26

11

As an alternative, you could use an external timer and a force shutdown at the correct time. For example:

timeout -t 3600 -nobreak && shutdown -s -t 00

Note that a caveat of this approach is that the shutdown command is not actually send (e.g. to networked computers) until the timeout is finished, therefore you will need the sending computer to be on with a working connection at the end of the timeout. A workaround is to run the entire command directly on the target computer, e.g. with PsExec.

If you want to hide the command window as well, there are many ways to do so.


I personally favour a PowerShell-based command that hides itself (run from a cmd window in this case):

start powershell.exe -WindowStyle Hidden -Command "sleep 3600; shutdown -s -t 00"

PowerShell can be configured for remoting, too. And it might be preferable to use the native Stop-Computer command rather than shutdown.

Bob

Posted 2013-03-02T08:49:21.883

Reputation: 51 526

No good. This only works if the command prompt window is left open. So it just replaces the shutdown notification window which CAN be closed without affecting the scheduled shutdown, with a command prompt window which must be left open for the scheduled shutdown to happen. – Austin ''Danger'' Powers – 2013-03-03T01:48:13.860

@Dan My thought was that this is more suitable for network shutdowns, as it will not alert the user (if you're shutting down your own computer, why would an alert need to be hidden?). However, yes, the caveat is that the command is not actually sent to the target computer until the timer is finished, and therefore the window will have to be left open (unless you execute the whole thing on the target computer, e.g. using PsExec). Do note that timeout was just an example of the concept of using an external timer; there are many other ways of doing so, some less obtrusive. – Bob – 2013-03-03T01:54:30.803

Oh I see what you mean. I thought the OP was asking for a command that would be run locally on a machine because he didn't mention the /m switch. – Austin ''Danger'' Powers – 2013-03-03T01:58:17.117

@Dan I've added a method that does not require an open command-line window. The caveat with the shutdown command not being sent until the timeout expires is still there, but PsExec is a workaround. It's still not as robust as shutdown, which (I believe) sets a scheduled task or similar, while this process can still be ended. A more robust solution may be to calculate the actual shutdown time and add a scheduled task, which can be done within the command-line with the at command. – Bob – 2013-03-03T02:17:25.180

2

You will have to turn off the automatic logoff command task..

 Windows -> Start -> Run -> shutdown -a

Lucky

Posted 2013-03-02T08:49:21.883

Reputation: 422

1

Add the -p flag to avoid the "System will shutdown in 10 minutes" message.

shutdown -p -s -t 3600

Raen

Posted 2013-03-02T08:49:21.883

Reputation: 19

1-p flag meant "Turn off the local computer with no time-out or warning.", so it will cancel timeout waiting, so can't be used with -t flag. – tomexou – 2018-02-06T11:56:55.733

0

If you want to cancel the shutdown, use this command, use shutdown -a. If you just want to hide the notification:

  1. Make it appear by running shutdown -s -t 3600.
  2. Right-click on the clock and select Customize notification icons.
  3. Find Windows logon reminder and choose Hide icon and notifications.

Shutdown tooltips won't appear on that computer anymore and the icon will be hidden.

gronostaj

Posted 2013-03-02T08:49:21.883

Reputation: 33 047

1"Shutdown tooltips won't appear on that computer anymore and the icon will be hidden." They will still show on that computer, just not for one specific user. If you log in as a different user the display settings for the "Windows Logon Reminder" will still be at their default setting (which is "show notifications"). – Austin ''Danger'' Powers – 2013-03-02T10:31:38.850

I didn't mean the bubble in the notification area. – The Wavelength – 2013-03-02T18:56:54.247

In that case my answer was correct: it can't be suppressed. – Austin ''Danger'' Powers – 2013-03-03T01:43:09.433

0

You can also use the Task Scheduler utility.

Start Menu -> Search "Task Scheduler"

Action -> Create Basic Task

Choose the time and frequency for which you want the event to occur.

Once you get to the Action section, select "Start a Program" and choose:

"C:\Windows\System32\shutdown.exe"

and give the appropriate parameters for the arguments:

/s /f /t 0

These argmuments break down as follows: /s shutdown /f force the shutdown /t 0 t for time, 0 seconds

Click finish and you're good to go.

Khobalt

Posted 2013-03-02T08:49:21.883

Reputation: 1