2011年7月3日 星期日

[C#] 命令提示字元指令

//關機
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\shutdown.exe", "-f -s -t 0");

//登出
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\shutdown.exe", "-l");

//休眠
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\rundll32.exe","powrprof.dll,SetSuspendState");

//重新開機
System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\shutdown.exe", "-f -r -t 0");

沒有留言:

張貼留言