Open In App

How to Shut Down a Computer using Command Prompt?

Last Updated : 01 Oct, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

Sometimes, situations might arise due to either a windows bug or some malicious program that start menu tray won’t open even on the press, leaving us with only forcing the desktop or laptop to shut down by either long pressing the power button or cutting off the power supply of the device.

To overcome such a situation, there are various efficient least time-consuming methods of shutdown, here in this article we will show you one of such ways to shutdown a computer in multiple ways. Go through the following command and save that as a .bat file. This .bat on getting executed (by a simple double click or other methods) should initiate the shutdown process.

Open Command Prompt (cmd) and type:

shutdown /s

or,

shutdown -s

The above command will schedule a shutdown, the Windows machine should be scheduled to shutdown within a minute of executing this command.  It should look something like this:

After execution of this command, you would see something similar like this:

Canceling the Shutdown:

  • To cancel a scheduled shutdown via this method simply type:
shutdown /a

or,

shutdown -a

Remote Shutdown:

  • The remote shutdown of a computer (GUI aided) in network can be done with the help of the following command:
shutdown /i

or,

shutdown -i

Shutdown commands with additional parameters:

  • You can save the above code as a .bat file, and execute it instead of always clicking start > power > shutdown. Save with -t 00 parameter, so that the shutdown is instantaneous. Basically type & save:
shutdown -s -t 00
  • To have a windows machine shutdown after a custom set time, type:
shutdown -s -t 900

 ( -t is superseded by time in seconds, for example, if we want an immediate shutdown, we can write: shutdown -s -t 00. Also, as stated above, you can just as easily cancel a scheduled shutdown or restart like this by typing, shutdown -a )

  • To have the windows machine restart instead of shutdown, type:
shutdown -r

(you can have -t and other parameters in this command. Type shutdown /? for more information on other available parameters)

Additional Note:

  • For instant and most efficient shutdown process, open any text editor software, namely notepad (comes in-built with windows) and write:
shutdown -s -t 00

and then save the file with .bat extension. Now simply execute this .bat file to initiate an instantaneous shutdown.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads