Shutdown+PC+with+extended+options

Shutdown PC with extended options

To shut down your computer from the command line (CMD ), type ʺshutdown ‐sʺ.

This could be used in a batch file, for example.

However, this does not shut down immediately ‐ it gives a 30 second countdown.

To see further options for the shutdown command, type ʺshutdownʺ at the command prompt in DOS, and it will show you a list of options.

You can even shut down another PC remotely!

Logoff, and restart are other options.

Here is a list of other flags you can use along with another usage example:

Usage: shutdown

[‐i | ‐l | ‐s | ‐r | ‐a] [‐f] [‐m \\computername] [‐t xx] [‐c ʺcommentʺ] [‐dup:xx:yy]

‐iI Display GUI interface, must be the first option

‐l Log off (cannot be used with ‐m option)

‐s Shutdown the computer

‐r Shutdown and restart the computer

‐a Abort a system shutdown

‐m \\computername Remote computer to shutdown/restart/abort

‐t xx Set timeout for shutdown to xx seconds

‐c ʺcommentʺ Shutdown comment (maximum of 127 characters)

‐f Forces running applications to close without warning

‐d [u][p]:xx:yy The reason code for the shutdown

U is the user code

p is a planned shutdown code

xx is the major reason code (positive integer less than 256)

yy is the minor reason code (positive integer less than 65536)

Now create a shortcut to close how you prefer

Do take care though won’t you