执行在Windows关机批处理脚本 [英] Executing a batch script on Windows shutdown

查看:1295
本文介绍了执行在Windows关机批处理脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法,在 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


  1. 运行输入gpedit.msc 来打开组策略编辑器,

  2. 导航到计算机配置| Windows设置|脚本(启动/关机)

  1. Run gpedit.msc to open the Group Policy Editor,
  2. Navigate to Computer Configuration | Windows Settings | Scripts (Startup/Shutdown).

这篇关于执行在Windows关机批处理脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆