In this article, we are going to show you how to shut down your Windows computer using the command line.
Steps

Step 1. Open the Start menu
To do this, click on the Windows logo in the lower right corner of the screen, or press the ⊞ Win key on your keyboard. The cursor will appear in the Start menu search bar.

Step 2. Enter Command Prompt in the Start Menu search bar
This will search for the Command Prompt utility and appear at the top of the Start menu.
- To open the search bar in Windows 8, move your mouse to the upper-right corner of the screen, and then click the magnifying glass icon.
- In Windows XP, click the Run utility on the right side of the Start menu.

Step 3. Right click on the Command Prompt utility
Its icon looks like a black square with white symbols. A menu will open.
In Windows XP, type cmd in the Run window

Step 4. Click Run as administrator
It's near the top of the menu. A command prompt window will open with administrator rights.
- To confirm your choice, click "Yes" when prompted.
- In Windows XP, click OK to open a Command Prompt window.
- You will not be able to run Command Prompt with administrator rights if filters are installed on the computer, or on a public computer or on a networked computer (for example, in a library or at a school).

Step 5. Enter shutdown -s at the command line
This command will shutdown the computer within one minute.
- To shutdown the computer immediately, enter shutdown -s -t 00 at a command prompt.
- To shutdown the computer after a specified number of seconds, enter shutdown -s -t ##, where "##" is the number of seconds (for example, "06" is six seconds, "60" is one minute, "120" is two minutes, and etc).

Step 6. Press ↵ Enter
The command will be executed and the computer will shut down. This will usually happen within a minute.