简体   繁体   English

强制System.Diagnostics.Process.Start(“ shutdown”,/ s / t 0“)

[英]Force System.Diagnostics.Process.Start(“shutdown”, /s /t 0")

System.Diagnostics.Process.Start("shutdown", /s /t 0");

Is it possible to add "/f" before "/s"? 是否可以在“ / s”之前添加“ / f”? Similarly to how you would add "-f" to "shutdown -t 0 -r". 与将“ -f”添加到“ shutdown -t 0 -r”类似。

In other words, how can I force a shutdown. 换句话说,我该如何强制关机。

It works. 有用。

Open programs or anything you are working on that preempts saving before closing (like Notepad , Word , Visual Studio ...etc ).....and they are all closed off without your intervention, it forces it! 打开程序或您正在处理的任何东西都可以在关闭之前先保存(例如NotepadWordVisual Studio ...等).....。它们都在没有您干预的情况下被关闭,它会强制执行!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM