Shutdown windows
Im a beginner amd my english is very bad but i hope you understand this. I have been writing simple ultity, and i need to shutdown windows in it.
I tried this line but it doesnt work:
System.Diagnostics.Process.Start(@"%windir%\System32\shutdown.exe -s -t 00");
How do i do it? Can you please give ma an example?
Kyaw ZinPosted Jun 7, 2006, 6:13 AM
sbugigPosted Jun 7, 2006, 2:56 AM
Try this first, Go to MSDOS command line, a the prompt type this:
Shutdown -S and press enter
OR
Shutdown -R and press enter
If all works then this below will work
NOW
Try this get back if it does not work:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.Arguments="-S"; // this is an option to the command shutdown
p.StartInfo.FileName="shutdown.exe";
p.Start();
You can use Management instrunentation to shut down comuters on your network, if you need code for this tell me
Abigail WatsonPosted Jun 4, 2006, 1:28 PM