Windows 8 Shutdown Command

How to Shut Down Windows 8

There are three parts to this page.  Quick instructions to find the Windows 8 Shut down button, creating a shutdown tile for the Metro-style UI, and learning the Shutdown switches.

Windows 8 ‘Shutdown’ Topics

 ♦

Finding the Windows 8 Shut down Button

Before I discuss tricks with the shutdown executable, a few words for those newbies who are struggling to find the normal shutdown button.  Firstly, ‘Sign out’ by clicking on your account icon, then at the main front screen seek out the Power button (see screen shot below).  Click, and you have the option to Shut down or Restart.

Windows 8 Shut down Logoff

Windows 8 Shut down with Keyboard
Surprisingly, the Alt +F4 brings up the Shut down or Sign out screen. Another keyboard method is to call for the Power button by pressing WinKey +i.

Windows 8 Shutdown Plan B – Turn on the Charm!
Many users prefer to bring up the 5 'Charms' by touching the right side of the screen, select the Settings cogs, and then click on the Power button at the bottom of the screen. 

How to Create a Windows 8 Shutdown Tile

Here are instructions to create a Shut down button in the Windows 8 Metro interface.  Confession: it took me three goes before I got it to work.  My point: there is less scope than usual to deviate from the ‘official’ script.  It helps if you understand these 3 underlying principles.How To Create a Windows Metro Shutdown Tile

  1. There is a knack to creating the shortcut, my biggest mistake was trying to create shortcuts to xyz.cmd, abc.txt files; they did not work, but paring down to this bare command worked:
    C:\windows\system32\shutdown /s /t 20
  2. There is a special location which houses the shortcuts to all the tiles:
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs
    Note: Start at ProgramData not ProgramFiles.
  3. You can Pin (and Unpin) tiles to the Metro UI.

Detailed Instructions to Create a Windows 8 Shutdown Tile

  1. Start on the Windows 8 desktop, or in a new folder – anywhere except in the Start Menu folder!
  2. Right-click, New, Shortcut.  Paste this instruction:
    C:\windows\system32\shutdown /s /t 20 (remember the space between t and 20)
  3. Name the shortcut after yourself, e.g. Guy’s Shutdown, that way you will recognise it easily!
  4. From the Metro-style UI, type the name of your newly-created short.  Right-click and 'Pin to Start'.

Plan B

  1. Use Windows Explorer to navigate to the crucial folder:
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs
  2. Paste the shortcut.  You may wish to click on the advanced button and ‘Run as administrator’.
  3. In passing you can see that it’s not possible to create a new shortcut here.
  4. It’s reassuring to see your shortcut amongst the other Apps.
  5. Return to the Metro UI start screen – Windows Key is the quickest way.
  6. Now, you may see your shortcut at the extreme right of the Metro screen.  If not type the first letter, then you should see a list of Apps beginning with that letter.  If yours is there, then Right-click its icon and see if it says Pinned or Unpinned, naturally you want it to be Pinned.  See more on how to create a Windows 8 Metro-style Tile.

Windows Shutdown Tile Variations: 
Change your shortcut’s icon.  Right-click, Properties, Change Icon.  There is a classic orange square with a vertical line.  See screenshot above.

Tweak the Shutdown command, at least while your testing you may wish to change /t 20 to /t 120.  The benefit is you can go to the command prompt (or PowerPoint) and issue the counter-command: Shutdown /a.  This aborts the shutdown.

Challenge 1: Make a second tile but with the Shutdown /a command.  See screenshot above. 

Challenge 2: Create a tile that instead of shutting down, restarts your Windows 8 computer.  Key command Shutdown /r.

Guy Recommends: SolarWinds Free Wake-On-LAN UtilitySolarwinds Wake-On-LAN

Encouraging computers to sleep when they’re not in use is a great idea – until you are away from your desk and need a file on that remote sleeping machine!

WOL also has business uses for example, rousing machines so that they can have update patches applied.  My real reason for recommending you download this free tool is because it’s so much fun sending those ‘Magic Packets’. Give WOL a try – it’s free.

Download your free copy of SolarWinds Wake-On-LAN

Launching  Microsoft’s Windows 8 ShutdownWindows 8 Shutdown

The rest of this page explains how to fine-tune the shutdown command by appending a variety of switches.

While you can execute shutdown from the command line you can also run it from a GUI by typing Shutdown -i.   Incidentally, this highlights a heated debate, should you precede switch with a slash or a hyphen?  Frankly, it does not matter, for instance, Shutdown /i works just the same as Shutdown -i.

Your First Decision – Turn Off or Reboot?

People often wonder why you need the /s (Shutdown) switch at all; well, the reason is that you need to tell the operating system whether you want to turn off the machine with /s, or alternatively reboot with /r.

Shutdown /s

Remote Shutdown Command

®

Once we have mastered the crucial /s switch we can extend the Microsoft Shutdown command to act on remote machines.

Shutdown /s /m \\ComputerName

Note 1: I always get in a tangle with the /m (machine) switch.  Pay close attention to its position (after /s or /r) and remember to introduce the victim machine with a double backslash \\ victim.

 Note 2: Observe that there is no space between the backslashes and the computername
\\  ComputerName would not work.

Here is an example to restart a server called ‘BigSrv’.

Shutdown /r /m \\BigSrv

Note 3: Remember the sequence of switches is vital, hence shutdown /m /s \\Laptop does not work, too many switches, and not paying attention to their order gets me into a tangle.

Note 4: By default, the UAC (User Account Control) interface will not allow remote shutdown, I have my UAC turned off, so had not noticed.  I thank Per Johansson for this additional information.

Fast Track Learning: Master /a for Abort Shutdown

Sooner or later everyone makes the mistake of accidentally shutting down the local machine instead of the remote target computer.  To cancel the command practice with Shutdown /a so that you can always abort a mistake within the 30 second default before the shutdown starts.Windows 8 Shutdown cancel /a

Shutdown /a

If you make a more serious mistake and apply the Windows 8 shutdown command to the wrong machine then you are in trouble.  No amount of trying Shutdown /a on the local machine will have any effect.  You have to run to the target machine and issue the cancel command at that machine.  My plan B is to launch remote desktop, there is a faint chance that I can connect in time and issue Shutdown /a.

shutdown /r /m \\Laptop – Reboots a remote machine called ‘Laptop’.

Tip: Create a shortcut.  Right-click the desktop, New, Shortcut: Just type:
Shortcut -i   Press OK and a shortcut is born.

Guy Recommends:  A Free Trial of the Network Performance Monitor (NPM)Review of Orion NPM v11.5 v11.5

SolarWinds’ Orion performance monitor will help you discover what’s happening on your network.  This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.

What I like best is the way NPM suggests solutions to network problems.  Its also has the ability to monitor the health of individual VMware virtual machines.  If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.

Download a free trial of Solarwinds’ Network Performance Monitor

Microsoft Windows 8: Additional Shutdown Commands

/t is for time.  Is 30 seconds too long (or too short)?   Adjust the setting with /t 10, and thus display the dialog box for 10 seconds.  Maximum is 600 seconds.

/f is for force.  This means shutdown is coming, ready or not!  Shutdown /r /f restarts the local machine, and closes all programs without warning.

/c is an option Microsoft included so you can add a comment.  I only use this when applying Shutdown to remote machines. Would you let people know who is in charge, who is shutting them down?  /c "Guy is shutting you down"

/d p:4:1 reason.  I would avoid this switch, the syntax is tricky, the numbers obscure, and worst of all it does nothing exciting.  However, the idea is sound, it enters a reason for the shutdown in the event log.  If you activate shutdown’s help, then you will get a whole list of major and minor reasons that you could employ with this switch.  For me, this switch is simply an option I would rather not take.

 /a  Abort shutdown command.  See more about Cancel Windows Shutdown

Reminder: The shutdown command-line switches work equally well with a dash, for example, -d, -r, or -a 
(instead of /d, /r, or /a)

 

Full List of Windows 8 Shutdown Switches

Windows 8 Shutdown Switches from Microsoft’s Help

Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
[/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

/i Display the graphical user interface (GUI). This must be the first option.
/l Log off. This cannot be used with /m or /d options.
/s Shutdown the computer.
/r Shutdown and restart the computer.
/g Shutdown and restart the computer. After the system is rebooted, restart any registered applications.
/a Abort a system shutdown. This can only be used during the time-out period.
/p Turn off the local computer with no time-out or warning. Can be used with /d and /f options.
/h Hibernate the local computer. Can be used with the /f option.
/e Document the reason for an unexpected shutdown of a computer.
/m \\computer Specify the target computer.
/t xxx Set the time-out period before shutdown to xxx seconds.
The valid range is 0-315360000 (10 years), with a default of 30. If the timeout period is greater than 0, the /f parameter is implied.
/c "comment" Comment on the reason for the restart or shutdown. Maximum of 512 characters allowed.
/f Force running applications to close without forewarning users. The /f parameter is implied when a value greater than 0 is specified for the /t parameter.
/d [p|u:]xx:yy Provide the reason for the restart or shutdown.
p indicates that the restart or shutdown is planned.
u indicates that the reason is user defined. If neither p nor u is specified the restart or shutdown is unplanned.
xx is the major reason number (positive integer less than 256).
yy is the minor reason number (positive integer less than 65536).

An Alternative to Windows 8 Shutdown: PowerShell’s Stop-Computer

PowerShell has a Stop-Computer, which is very similar to the Windows 8 shutdown -s command.  A likely scenario is that you wish to automate the reboot of a remote server.  With a tiny substitution of ‘Restart’ for ‘Stop’ you could change the command so that it reboots the computer.  See more about using PowerShell’s Stop-Computer cmdlet.Windows 8 Shutdown Group Policy Pagefile

How To Stop Nutters from Remotely Shutting Down Computers

Trust me, every organization has a joker, someone who thinks it’s funny to use shutdown -s or -r to play pranks on colleagues.  The good news is you can configure a policy to prevent ‘Force Shutdown From A Remote Machine’.

Launch GPMC or SECPOL.MSC
Navigate to Local Policies, User Rights Assignment.

Experiment by assigning just your account, rather than all administrators.Turn off Shutdown Event Tracker in Windows Server 2003 See also group policies to control Shutdown: Clear pagefile.

Separate Problem Event Tracker

How to disable the Windows 8 shutdown tracker.

Here are instructions to modify group policy to disable shutdown tracker.

Summary of How to Shut Down Windows 8

Learning Microsoft’s Windows 8 shutdown command line switches is satisfying, and one day they will save you a long trek when you want reboot a remote computer.  My advice is to perfect the /a (abort) switch, that way you won’t panic if you issue a command to shutdown the wrong machine.

If you like this page then please share it with your friends

 


Microsoft Windows 8 Topics

Windows 8 Overview  • Windows 8 Event Viewer  • Win 8 Security Event Log  • Log Event Manager

Win 8 Task Manager  • Close Windows 8 Apps  • Windows 8 SkipRearm   • Windows 8 File History

Windows 8 App Store  • Windows 8 Safely Remove Hardware  • Windows 8 Shutdown Command