Shutdown computer via shutdown commands in the command line

shutdown

The "shutdown" command in the command line makes the computer shut down. This alone would not be spectacular. But there are also a number of additional functions that make "shutdown" a useful gimmick that can save a lot of time and energy under certain circumstances. what functions the "shutdown" command has and how you can best use it, we will show you in this blog article.

First you have to command line call in windows. You do this either by typing "cmd" into the search function of the windows-button or by opening the "execute"-function with windows-key + R and searching for "cmd" there.

Overview of shutdown commands:

If you have opened the command line, you can now give windows commands. the simple input "shutdown" has the same function as "shutdown -?"It will show you the available functions of the command:

shutdown overview functions

Our favorite shutdown commands:

  • Shutdown /f: your computer forces to close all open applications
  • Shutdown /l: your computer logs you off
  • Shutdown /s: your computer shuts down immediately
  • Shutdown /r: your computer restarts

You can use a few also combine commands. So you could use the following command to tell your computer to shut down in 40 seconds and then reboot:

In general, the parameter "/t"specify a period of time in seconds that has to elapse before the computer shuts down.

execute shutdown commands as batch file

You can use this to create your own little program that shuts down the computer automatically after a certain period of time. This would be useful, for example, if you still want to install a file, but don’t want to stay in the office that long, and also don’t want the computer to run all night long. Then you could have the computer shut down automatically during the night.

And this is how you create such a "mini-program":

Time required: 3 minutes.

Shutdown commands as batch file:

    Text editor

Open the text editor.

Type there the command to be executed. For example, if you want your PC to shut down automatically after 45 minutes (2700 seconds), type "shutdown /s /t 2700".

Enter shutdown command in editor

Then click on "file" and "save as" and save your document in a location of your choice, for example on the desktop.

It is important that you save the file as a batch filefile saves. So change the ending to .Bat

shutdown computer via shutdown commands in the command line

If you choose the desktop as location, an icon will appear on your desktop. If you click on this, your self-written mini-program will start.

by the way: if you have changed your mind in the meantime and don’t want your computer to shut down after a certain time, you can turn off the timer in the background again. This is what you do with the command "shutdown /a".

We hope this article was helpful for you. We would be very pleased about a positive evaluation!

Leave a Reply

Your email address will not be published. Required fields are marked *