• 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的博客.

  • 相关阅读:
    ==和equals的比较
    有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?
    while循环打印*菱形
    switch语句可以接受哪几种数据类型
    如何在不介入第三个变量的情况下实现两个数的交换
    HDU 1003 Max Sum --- 经典DP
    HDU 2717 Catch That Cow --- BFS
    POJ 2251 Dungeon Master --- 三维BFS(用BFS求最短路)
    HDU 2096 小明A+B --- 水题
    HDU 2095 find your present (2)
  • 原文地址:https://www.cnblogs.com/osnosn/p/14899171.html
Copyright © 2020-2023  润新知