[英]how to shutdown-restart-hibernate-stand by-log off computer using Process.Start()?
Im making a client-server application so i need to shutdown the remote pc Silently .. i've read about shutdown arguments in Commands Prompt shutdown/?
我正在制作一个客户端服务器应用程序,因此我需要静默关闭远程计算机..我已经阅读了命令提示符下的关机参数。 .. but i still don't know the right arguments to do the commands below.
..但我仍然不知道执行以下命令的正确参数。
so how do i do those commands locally without ( /m ) ?
那么如何在没有( / m )的情况下本地执行这些命令呢?
void ShutDown(string cmd) { Process.Start("shutdown", cmd); }
thanks in advance. 提前致谢。
Try this: 尝试这个:
To ShutDown : shutdown -s
要关机 : shutdown -s
To Restart : shutdown -r
重新启动: shutdown -r
To Logoff : shutdown -l
要注销: shutdown -l
To Hibernate : %windir%\\system32\\rundll32.exe PowrProf.dll,SetSuspendState
要休眠: %windir%\\ system32 \\ rundll32.exe PowrProf.dll,SetSuspendState
To Lock : Rundll32.exe User32.dll,LockWorkStation
锁定: Rundll32.exe User32.dll,LockWorkStation
To Sleep : rundll32.exe powrprof.dll,SetSuspendState 0,1,0
进入睡眠状态: rundll32.exe powrprof.dll,SetSuspendState 0,1,0
Note:While using cmd for Sleep Need to off Hibernation else sys will be hibernated. 注意:虽然使用cmd进行睡眠需要关闭休眠模式,否则sys将进入休眠状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.