执行在Windows关机批处理脚本 [英] Executing a batch script on Windows shutdown
问题描述
有什么办法,在 Windows 7专业版
,运行批处理脚本(如.bat文件)时的停机用户点击(不是批处理文件计划关闭机器,只有一个,只有当用户点击关机)?
Is there any way, in Windows 7 Professional
, to run a batch script (e.g., a .BAT file) when the user clicks on "shutdown" (not a batch file scheduled to shut down the machine, just one that runs only if the user clicks on "shutdown")?
在理想情况下,这样的脚本将显示命令提示符窗口,并提供一个选项,取消关机操作。
Ideally, such a script would show the command prompt window and offer an option to cancel the shutdown procedure.
这不需要第三方实用的解决方案将是preferable。
Solutions that do not require a third-party utility would be preferable.
推荐答案
您可以在Windows上创建一个本地计算机策略。看到在TechNet <一个href=\"http://technet.microsoft.com/en-us/magazine/dd630947\">http://technet.microsoft.com/en-us/magazine/dd630947
You can create a local computer policy on Windows. See the TechNet at http://technet.microsoft.com/en-us/magazine/dd630947
- 运行
输入gpedit.msc
来打开组策略编辑器, - 导航到计算机配置| Windows设置|脚本(启动/关机)
- Run
gpedit.msc
to open the Group Policy Editor, - Navigate to Computer Configuration | Windows Settings | Scripts (Startup/Shutdown).
这篇关于执行在Windows关机批处理脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!