The command prompt comes back to pre-windows computing.
Credit: Lifehacker
In an ideal world, you will lead a long and happy life, which will only be closed and will restart your PC through the start menu. Click on the power icon, choose your option, and you are. However, life does not always work as we plan it, and sometimes you may need to restart or trigger shutdowns from the command prompt.
Maybe some start menu is preventing working, or perhaps you find yourself on a screen where the start menu is not available. One of the scenarios where I use the command prompt to close Windows, when I am in the initial setup stage for the operating system and do not want to complete it immediately.

The shutdown command can close your PC on a timer.
Credit: Lifehacker
You must have also loaded the Command Prompt Interface to try a problem and troubleshooting a problem that is preventing Windows from working – in the situation in which you have to know how to power or reboot your computer without pressing and keeping the power button. (If you have PC issues, then also see this less-known emergency restart option.)
Using Command Prompt
If you are completely new to the command prompt, it is a text-based interface hidden in Windows, the computer operating system has a residual of old days before pointers and graphical user interfaces, and still useful to run a variety of low-level system operations.

Powershell does not look very different for the command prompt at first glance.
Credit: Lifehacker
The command prompt is also accompanied by Powershell, a more modern and convenient-rich version of this interface. As far as these shutdown and restart commands are concerned, you can either use the job, but if you ever need to run more advanced text commands, scripts and automation, then Powershell is better set up to adjust them.
You can launch the command prompt or powerrashel from the Start menu: just type them in the search box at the top to find them either the first few letters of utility. There are many other options, such as right-clicking on the Start menu button TerminalOr typing “CMD” in the search box on taskbar enter,
Using the “Shutdown” command
The text command that you need to turn off or restart your Windows computer is ‘shutdown’. If you type it in command prompt or powerrashel and then hit enterYou will find complete details of the shutdown, and all methods you can use (by the way, you can add “more” to this or any command to see a page of text at a time).
Type “Shutdown /S” to trigger a standard shutdown
The most basic flags you need “shutdown /s” and “shutdown /r” respectively, so that you can restore your computer respectively and respectively. In both cases you will see a dialog box on the screen, which is telling you what is happening, and the action is taken in less than a minute. These commands will begin a common shutdown process, so you will be motivated to save any unheard work in your open programs that usually do so.
What do you think so far?

This will restart Windows and launch advanced boot option screen.
Credit: Lifehacker
Type “Shutdown /S /F” to force a shutdown
To force all apps to close without any other signal – perhaps if you need to make sure that the shutdown or restart goes without a bottleneck – for a shutdown by the end of your command or for a shutdown /s /f “for a shutdown or for a shutdown /r /f”). You do it at your risk, although with the risk of losing data which has not already been saved, and it is probably the best left as the last remedy.
Type “Shutdown /R /O” to reach advanced boot options
For troubleshooting purposes, “shutdown /r /o” command is useful as it rebits your computer into an advanced boot option screen. This is the one that offers you access to features such as using USB drives to recover your PC, run the underlying start-up repair utility and use a USB drive to return the recent updates on Windows. You can also return to the command prompt from here without starting the operating system.

The shutdown command can also be used to prevent shutdowns.
Credit: Lifehacker
Time of your shutdown by adding “/t”
Another flag that can be useful is “/T” flag after a place and a number. It delays the shutdown or restart, which gives you time to close the apps or finish the download. The number of seconds is the number of windows should wait, and it can go from 0 (immediately) to 315360000 – if you were thinking, it’s 10 years old. If there are anything sets above the second zero, the “/F” flag is also installed.
Stop a shutdown with “Shutdown /A”
A final one that you may find you may seem to be helpful: you can use “Shutdown /A”, which is currently running (perhaps set on a timer). All those methods can completely use this command, including some advanced options for IT managers (eg remote shutdowns), see Official microsoft documentation,