zoukankan      html  css  js  c++  java
  • windows_10_2008r2_2016server_开机startup_关机shutdown_分别执行bat脚本

    windows_10_2008r2_2016server_开机startup_关机shutdown_分别执行bat脚本

    转载注明来源: 本文链接 来自osnosn的博客,写于 2021-06-16.

    参考

    win10 开机、关机时,执行脚本

    • 因 gpedit 被禁用,没有权限。所以用注册表导入的方法指定开关机执行的脚本,win10专业版17763测试成功。(2021-06)
    • 相关的注册表内容。开机:
      HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyScriptsStartup
      HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsStartup
      HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionGroup PolicyScriptsStartup
      HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsStartup
      字符串key Script=C:xxxxxxx.bat
    • 相关的注册表内容。关机:
      HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyScriptsShutdown
      HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsShutdown
      HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionGroup PolicyScriptsShutdown
      HKEY_LOCAL_MACHINESOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsShutdown
      字符串key Script=C:xxxxxxx.bat
    • 开机 reg-startup.reg:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScripts]
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsStartup]
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyScriptsStartup]
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsStartup]
    "GPO-ID"="LocalGPO"
    "SOM-ID"="Local"
    "FileSysPath"="C:\Windows\System32\GroupPolicy\Machine"
    "DisplayName"="Local Group Policy"
    "GPOName"="Local Group Policy"
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsStartup]
    "Script"="C:\Scripts\startupEv.bat"
    "Parameters"=""
    "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyScriptsStartup]
    "GPO-ID"="LocalGPO"
    "SOM-ID"="Local"
    "FileSysPath"="C:\Windows\System32\GroupPolicy\Machine"
    "DisplayName"="Local Group Policy"
    "GPOName"="Local Group Policy"
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyScriptsStartup]
    "Script"="C:\Scripts\startupEv.bat"
    "Parameters"=""
    "IsPowershell"=dword:00000000
    "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
    
    • 关机 reg-shutdown.reg:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScripts]
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsShutdown]
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyScriptsShutdown]
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsShutdown]
    "GPO-ID"="LocalGPO"
    "SOM-ID"="Local"
    "FileSysPath"="C:\Windows\System32\GroupPolicy\Machine"
    "DisplayName"="Local Group Policy"
    "GPOName"="Local Group Policy"
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyStateMachineScriptsShutdown]
    "Script"="C:\Scripts\shutdownEv.bat"
    "Parameters"=""
    "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyScriptsShutdown]
    "GPO-ID"="LocalGPO"
    "SOM-ID"="Local"
    "FileSysPath"="C:\Windows\System32\GroupPolicy\Machine"
    "DisplayName"="Local Group Policy"
    "GPOName"="Local Group Policy"
    
    [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionGroup PolicyScriptsShutdown]
    "Script"="C:\Scripts\shutdownEv.bat"
    "Parameters"=""
    "IsPowershell"=dword:00000000
    "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
    
    • 按需,分别双击 reg-startup.reg,reg-shutdown.reg 导入到注册表即可。

    转载注明来源: 本文链接 来自osnosn的博客.

  • 相关阅读:
    jdbc学习一半的代码
    实验室的毕业照
    IOS_地图_定位_天气预报_Block回调_单例
    POJ -1062 昂贵的聘礼(前向星 && SPFA)
    【监控】Nagios-NRPE脚本返回值
    cocos2d-x-3.0 Windos 新建项目(coco2d-x 学习笔记一)
    托付与事件
    Netty源代码学习——EventLoopGroup原理:NioEventLoopGroup分析
    vs2013 error c4996: 'fopen': This function or variable may be unsafe
    Customize User Interfaces and Pass User Input to Installer Classes
  • 原文地址:https://www.cnblogs.com/osnosn/p/14899171.html
Copyright © 2011-2022 走看看