USE A BATCH FILE TO SHUT DOWN OR RESTART A SYSTEM

If you write batch files for maintaining your systems and need to shut down a computer at the end of the procedure, add this command to the end of the file:

Rundll.exe user.exe,exitwindows

This command can also be used as a command line for a shortcut to quickly shut down the computer from the desktop rather than going through the Start menu.

It's also possible to restart a system from a batch file, which is handy at the end of a script that updates a system and requires a restart to make the changes effective. To do so, add this line to the end of the file:

Rundll.exe user.exe,exitwindows (restart)

Make sure there's a space between exitwindows and (restart), or it will error.