Shutdown Computer using Command Prompt

Computer administrators are familiar with various Windows DOS commands.  These commands are very useful for network administrators to shutdown Windows remotely via command line. Today, I am going to share some useful computer shortcuts to shutdown computer with command prompt remotely and locally. This includes shutdown, restart, logoff, and close all application using command prompt.

In order to execute any of these commands first go to command prompt: Start > Run > (Type “cmd” in run window and hit enter OR Press Windows Key + R.

  • Windows shutdown command for Local Computer

shutdown -s

 

  • How to Specify the time in command line while shutting down the Windows

shutdown -s -t 120

Here “-t” specifies time for Windows shut down time. You will get a new pop up appears saying “Windows will shut down in 2 minutes?”

shut down command prompt window“120” is the number of seconds specified.

 

  • How to abort Windows Shutdown using Command line

shutdown -a

shutdown command linecommand prompt shutdown

When you receive a shut down prompt you can abort this process by typing “shutdown -a” in command prompt, In windows 7  a pop up appears saying “Logoff cancelled”.

  • Remote Shutdown Windows Commands

shutdown -s -m \\computername -t 60

Here we include “-m” to shutdown remote computer on the network and for “computername” you can specify the computer name or IP address of the remote computer. “-t 60 indicates within 60 seconds computer will shutdown. Note: Remote shutdown for Windows is possible only with admin rights.

  • Add a comment while Shutting down the Remote Computer.

shutdown -s -t 120 -c “I am going to shut down your computer remotely”

You can include reason for windows shut down by just adding “-c” and the message.

  • Windows Restart Command for Remote Computer

shutdown -r -m \\computername

Here we use  “-r” to restart the computer. “computername” you can specify the computer name or IP address of the remote computer.

 

Windows Command Prompt Shutdown Command List

-t xx  “xx” specify number of seconds to shutdown Windows
-a  Abort Windows shutdown which is already in progress
-r  Windows restart command
-s  Windows shutdown command
-f  This command forces the existing applications to close without warning
-c  You can leave a comment or message while Shutting down down the windows.
m \\computername   This command is used to access remote computers.

 

Shutdown Command Line Examples:

Typeshutdown –m \\computername –r –f

This command will restart the remote computer and forces all the application to close.

 

Typeshutdown –m \\computername –r –f –c “I am going to restart your computer now. Please save all the files ” –t 120

This command display’s a message to remote user and it will shut down in 2 minutes.

Comments

  1. abel says:

    hey this is abel your tutorial is so nice i love it ok can you sent to me another command promp .i want to now moer about command ok sent to me by my E-mail see you,,,,abel form Ethiopia

  2. Dave says:

    Thank you for this great article! It was well-written and very easy to follow. I had tons of fun shutting down my co-workers’ computers ;) Thanks!

  3. cmd says:

    Command to shut down android??

  4. Mr.Java says:

    I just want to Say “Thank you very much for all this piece of information” .
    Now I can have the control of the computers that are in my house ; Well I would like to know how to shutdown Android and IOS based machines such as ipads or iphones the will be a lot of help for me if you could tell me the answer.

  5. seb says:

    Hey man, useful article. I know this is a very old, but I was wondering if you could help me as I cannot find a solution anywhere. I use this command regularly when watching a film before going to bed. If I have 20 minutes left of the film ill set the shutdown timer to end after 20 minutes, which is great. But 10 minutes in, it will popup with a warning that my computer will shutdown, blocking my view of the film which is very annoying. Do you know of anyway to solve this problem?
    Thanks.

  6. Jathavedas says:

    I want to know how to shutdown using command prompt, without the popup window appearing so that the system shuts down unknowingly to other users. Is there any solution to this??? Thanks in advance… :-)

Speak Your Mind

*