Restart, shutsdown, logoff Windows from command line

It’s often need to restart, shutsdown, logoff Windows from command line. For example, if you connect to OS via remote desktop protocol you can’t restart/shutdown it from UI.
In such case you can use next:

shutdown -r
restarts os

shutdown -s
shutdown os

shutdown -l
logoff os

shutdown -t xx
where xx is number of seconds to wait till shutdown/restart/logoff

shutdown -i
gives you a dialog box to fill in what function you want to use

shutdown -a
aborts the previous shutdown command....very handy!

Additional options:

force the selected action

Thanx to