How to shutdown and restart windows from within a c# program
-
Thursday, October 18, 2007 11:50 AMI have been struggling for a while now, trying to shutdown and restart windows from within my c# application. I would be very glad if anyone could help. I am a beginner in c# please.
Answers
-
Thursday, October 18, 2007 12:33 PM
All Replies
-
Thursday, October 18, 2007 12:33 PM
-
Thursday, October 18, 2007 12:38 PMHi there,
System.Diagnostics.Process.Start("ShutDown", "/s");
you can put it in click event of a button for example. -
Tuesday, October 23, 2007 8:49 AM
System.Diagnostics.Process.Start("ShutDown", "/s");to shutdown
System.Diagnostics.Process.Start("ShutDown", "/r"); to restart
-
Wednesday, October 31, 2007 2:19 PM
System.Diagnostics.Process.Start("ShutDown", "/s");
List of all arguments are as following:
-r Shutdown and restart the computer
-s Shutdown the computer
-t xx Set timeout for shutdown to xx seconds
-a Abort a system shutdown
-f Forces all windows to close
-i Display GUI interface
-l Log off

