[TUT] How to make your program shutdown, restart, or log off user [TUT]
To shutdown your computer :
Code:
System.Diagnostics.Process.Start("shutdown.exe", "-s -t 0")
to restart:
Code:
system.Diagnostics.Process.Start("shutdown.exe", "-r -t 0")
to log off:
Code:
System.Diagnostics.Process.Start("shutdown.exe", "-l -t 0")
to change how man seconds until it execute the command, change the 0 at the end of the code to whatever amount of seconds you would like. 0 means it will shutdown immediately. 1 will make it shutdown in 1 second, and so on.
you could just use Shell
like
Shell("shutdown -s -t 100")