-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without war
ning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer le
ss than 256)
yy is the minor reason code (positive integer le
ss than 65536)
-l would be logoff
I had an idea for a program and saw this. Thank you for the advice, it really helped; however, I am not sure how to implement it all...
... when using the following commands, what is the correct way to input it?
following the example code given earlier, I typed:
ProcessStartInfo startInfo = new ProcessStartInfo("shutdown.exe", "-m \\COMPUTERNAME");
upon clicking the button this code was written for, nothing happened on the computer I was trying to shut down, though (unfortunately) my computer restarted after approximately 30 seconds. I don't think I input it correctly, or I was attempting to do something -m wasn't meant to do?
Also, when I typed "-t 10" (wanting the computer to shut down 10 seconds after the button was clicked, nothing happened.
Wat am I doing wrong?
Thanks for the help
j4nu5