In this post will show you How to turn off, log off, restart your windows computer by using windows command, and script it into batch file and allow you to execute it, step to create batch file for windows.
After you have save as .bat file format, key in the shutdows windows command(you may copy from below and paste it into the batch file), after you have key in just save it as normal for example press Ctrl+S.