简体   繁体   English

如何在打开一个特定应用程序时防止 windows 关机

[英]How to prevent windows shutdown while one particular app is open

Need help to parm.netly disable the "Shutdown anyway button" while shutting down the pc.需要帮助 parm.netly 在关闭电脑时禁用“仍然关闭按钮”。

or any batch file or application that stop the computer to shutdown while one particular app is open.或在某个特定应用程序打开时阻止计算机关闭的任何批处理文件或应用程序。

Means computer will not turn off while that particular app is opne untill I close that app.意味着在我关闭该应用程序之前,当该特定应用程序处于运行状态时计算机不会关闭。

pls suggest请建议

Tried registry tweaks but not working尝试过注册表调整但不起作用

You just need this batch code:你只需要这个批处理代码:

tasklist | find /i "application.exe" >NUL && shutdown -a

Put the application you want to select instead of "application".将您想要的应用程序放入 select 而不是“应用程序”。 The "tasklist" command will display all current running tasks in your system, and you need to use " | find /i" to search for a certain string (use /i to use case insensitive mode). “tasklist”命令会显示你系统中所有当前正在运行的任务,你需要使用“|find /i”来搜索某个字符串(使用/i 来使用不区分大小写的模式)。 The code after "&&" will be executed only if the code actually finds something (">NUL" is used to hide the output) “&&”之后的代码只有在代码真正找到东西时才会执行(“>NUL”用于隐藏输出)

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

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