Microsoft Windows offers several ways to shut down or restart your computer, one of which is via the command prompt.
To access the command prompt window from Windows 7, 8, or 10:
Go to the Start menu
Type cmd in the Search field
From an open command prompt window, type shutdown, followed by the option you wish to execute.
To shut down your computer, type: shutdown /s
To restart your compute,r type: shutdown /r
To log off your computer, type: shutdown /l
For a complete list of options, type: shutdown /?
After typing your chosen option, press Enter. The computer will execute your desired task.