Rss Feed

07 July 2006

Shutdown My Computer Programmatically in C#?

It is possible to use the .NET Process class to shutdown the computer. This is done by calling its Start() method with the arguments outlined below.

System.Diagnostic.Process.Start("shutdown.exe", "-s -f -t 00");

Addional information on how to use .NET Process class can be found at MSDN or by following the link below.

Process Class Documentation


Anonymous Anonymous said...

Thanks, this was a useful little tidbit.

19 August, 2008 07:55  
Anonymous Anonymous said...

Thanks Jessn , thanks. Code is working

06 March, 2009 12:14  
Anonymous Anonymous said...

Thanks man... ;)

05 May, 2009 13:30  
Blogger jessn said...

This might be useful too... It illustrates how to lock the computer programatically.

30 June, 2009 14:49  

Post a comment

<< Home