在使用時間期間關閉安裝更新後的自動重新啟動 的登錄值 SetActiveHours 等 2 個電腦HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate
- 原則 ID
- ActiveHours
- 適用範圍
- 電腦設定
- 支援的作業系統
- 至少需要 Windows Server 2016 或 Windows 10
- 來源
- Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (版本 1.0)
- 類別
- Windows 元件 › Windows Update › 管理使用者體驗
登錄
SetActiveHours
REG_DWORD電腦- 啟用時的值
- 1
- 停用時的值
- 0
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate] ; 選項 (只使用其中一個) ; 已啟用 "SetActiveHours"=dword:00000001 ; 已停用 "SetActiveHours"=dword:00000000
CMD
:: 選項 (只使用其中一個) :: 已啟用 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "SetActiveHours" /t REG_DWORD /d 1 /f :: 已停用 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "SetActiveHours" /t REG_DWORD /d 0 /f
PowerShell
# 共通: 建立機碼 New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null # 選項 (只使用其中一個) # 已啟用 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'SetActiveHours' -PropertyType DWord -Value 1 -Force | Out-Null # 已停用 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'SetActiveHours' -PropertyType DWord -Value 0 -Force | Out-Null
ActiveHoursStart
REG_DWORD電腦- 啟用時的值
- 取決於選項值
- 元素
- 開始:
| 項目 | 儲存的值 |
|---|---|
| 上午 12 點 | 0 |
| 上午 1 點 | 1 |
| 上午 2 點 | 2 |
| 上午 3 點 | 3 |
| 上午 4 點 | 4 |
| 上午 5 點 | 5 |
| 上午 6 點 | 6 |
| 上午 7 點 | 7 |
| 上午 8 點 | 8 |
| 上午 9 點 | 9 |
| 上午 10 點 | 10 |
| 上午 11 點 | 11 |
| 下午 12 點 | 12 |
| 下午 1 點 | 13 |
| 下午 2 點 | 14 |
| 下午 3 點 | 15 |
| 下午 4 點 | 16 |
| 下午 5 點 | 17 |
| 下午 6 點 | 18 |
| 下午 7 點 | 19 |
| 下午 8 點 | 20 |
| 下午 9 點 | 21 |
| 下午 10 點 | 22 |
| 下午 11 點 | 23 |
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate] ; 選項 (只使用其中一個) ; 上午 12 點 "ActiveHoursStart"=dword:00000000 ; 上午 1 點 "ActiveHoursStart"=dword:00000001 ; 上午 2 點 "ActiveHoursStart"=dword:00000002 ; 上午 3 點 "ActiveHoursStart"=dword:00000003 ; 上午 4 點 "ActiveHoursStart"=dword:00000004 ; 上午 5 點 "ActiveHoursStart"=dword:00000005 ; 上午 6 點 "ActiveHoursStart"=dword:00000006 ; 上午 7 點 "ActiveHoursStart"=dword:00000007 ; 上午 8 點 "ActiveHoursStart"=dword:00000008 ; 上午 9 點 "ActiveHoursStart"=dword:00000009 ; 上午 10 點 "ActiveHoursStart"=dword:0000000a ; 上午 11 點 "ActiveHoursStart"=dword:0000000b ; 下午 12 點 "ActiveHoursStart"=dword:0000000c ; 下午 1 點 "ActiveHoursStart"=dword:0000000d ; 下午 2 點 "ActiveHoursStart"=dword:0000000e ; 下午 3 點 "ActiveHoursStart"=dword:0000000f ; 下午 4 點 "ActiveHoursStart"=dword:00000010 ; 下午 5 點 "ActiveHoursStart"=dword:00000011 ; 下午 6 點 "ActiveHoursStart"=dword:00000012 ; 下午 7 點 "ActiveHoursStart"=dword:00000013 ; 下午 8 點 "ActiveHoursStart"=dword:00000014 ; 下午 9 點 "ActiveHoursStart"=dword:00000015 ; 下午 10 點 "ActiveHoursStart"=dword:00000016 ; 下午 11 點 "ActiveHoursStart"=dword:00000017
CMD
:: 選項 (只使用其中一個) :: 上午 12 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 0 /f :: 上午 1 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 1 /f :: 上午 2 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 2 /f :: 上午 3 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 3 /f :: 上午 4 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 4 /f :: 上午 5 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 5 /f :: 上午 6 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 6 /f :: 上午 7 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 7 /f :: 上午 8 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 8 /f :: 上午 9 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 9 /f :: 上午 10 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 10 /f :: 上午 11 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 11 /f :: 下午 12 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 12 /f :: 下午 1 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 13 /f :: 下午 2 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 14 /f :: 下午 3 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 15 /f :: 下午 4 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 16 /f :: 下午 5 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 17 /f :: 下午 6 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 18 /f :: 下午 7 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 19 /f :: 下午 8 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 20 /f :: 下午 9 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 21 /f :: 下午 10 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 22 /f :: 下午 11 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 23 /f
PowerShell
# 共通: 建立機碼 New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null # 選項 (只使用其中一個) # 上午 12 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 0 -Force | Out-Null # 上午 1 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 1 -Force | Out-Null # 上午 2 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 2 -Force | Out-Null # 上午 3 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 3 -Force | Out-Null # 上午 4 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 4 -Force | Out-Null # 上午 5 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 5 -Force | Out-Null # 上午 6 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 6 -Force | Out-Null # 上午 7 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 7 -Force | Out-Null # 上午 8 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 8 -Force | Out-Null # 上午 9 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 9 -Force | Out-Null # 上午 10 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 10 -Force | Out-Null # 上午 11 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 11 -Force | Out-Null # 下午 12 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 12 -Force | Out-Null # 下午 1 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 13 -Force | Out-Null # 下午 2 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 14 -Force | Out-Null # 下午 3 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 15 -Force | Out-Null # 下午 4 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 16 -Force | Out-Null # 下午 5 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 17 -Force | Out-Null # 下午 6 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 18 -Force | Out-Null # 下午 7 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 19 -Force | Out-Null # 下午 8 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 20 -Force | Out-Null # 下午 9 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 21 -Force | Out-Null # 下午 10 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 22 -Force | Out-Null # 下午 11 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 23 -Force | Out-Null
ActiveHoursEnd
REG_DWORD電腦- 啟用時的值
- 取決於選項值
- 元素
- 結束:
| 項目 | 儲存的值 |
|---|---|
| 上午 12 點 | 0 |
| 上午 1 點 | 1 |
| 上午 2 點 | 2 |
| 上午 3 點 | 3 |
| 上午 4 點 | 4 |
| 上午 5 點 | 5 |
| 上午 6 點 | 6 |
| 上午 7 點 | 7 |
| 上午 8 點 | 8 |
| 上午 9 點 | 9 |
| 上午 10 點 | 10 |
| 上午 11 點 | 11 |
| 下午 12 點 | 12 |
| 下午 1 點 | 13 |
| 下午 2 點 | 14 |
| 下午 3 點 | 15 |
| 下午 4 點 | 16 |
| 下午 5 點 | 17 |
| 下午 6 點 | 18 |
| 下午 7 點 | 19 |
| 下午 8 點 | 20 |
| 下午 9 點 | 21 |
| 下午 10 點 | 22 |
| 下午 11 點 | 23 |
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate] ; 選項 (只使用其中一個) ; 上午 12 點 "ActiveHoursEnd"=dword:00000000 ; 上午 1 點 "ActiveHoursEnd"=dword:00000001 ; 上午 2 點 "ActiveHoursEnd"=dword:00000002 ; 上午 3 點 "ActiveHoursEnd"=dword:00000003 ; 上午 4 點 "ActiveHoursEnd"=dword:00000004 ; 上午 5 點 "ActiveHoursEnd"=dword:00000005 ; 上午 6 點 "ActiveHoursEnd"=dword:00000006 ; 上午 7 點 "ActiveHoursEnd"=dword:00000007 ; 上午 8 點 "ActiveHoursEnd"=dword:00000008 ; 上午 9 點 "ActiveHoursEnd"=dword:00000009 ; 上午 10 點 "ActiveHoursEnd"=dword:0000000a ; 上午 11 點 "ActiveHoursEnd"=dword:0000000b ; 下午 12 點 "ActiveHoursEnd"=dword:0000000c ; 下午 1 點 "ActiveHoursEnd"=dword:0000000d ; 下午 2 點 "ActiveHoursEnd"=dword:0000000e ; 下午 3 點 "ActiveHoursEnd"=dword:0000000f ; 下午 4 點 "ActiveHoursEnd"=dword:00000010 ; 下午 5 點 "ActiveHoursEnd"=dword:00000011 ; 下午 6 點 "ActiveHoursEnd"=dword:00000012 ; 下午 7 點 "ActiveHoursEnd"=dword:00000013 ; 下午 8 點 "ActiveHoursEnd"=dword:00000014 ; 下午 9 點 "ActiveHoursEnd"=dword:00000015 ; 下午 10 點 "ActiveHoursEnd"=dword:00000016 ; 下午 11 點 "ActiveHoursEnd"=dword:00000017
CMD
:: 選項 (只使用其中一個) :: 上午 12 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 0 /f :: 上午 1 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 1 /f :: 上午 2 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 2 /f :: 上午 3 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 3 /f :: 上午 4 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 4 /f :: 上午 5 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 5 /f :: 上午 6 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 6 /f :: 上午 7 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 7 /f :: 上午 8 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 8 /f :: 上午 9 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 9 /f :: 上午 10 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 10 /f :: 上午 11 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 11 /f :: 下午 12 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 12 /f :: 下午 1 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 13 /f :: 下午 2 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 14 /f :: 下午 3 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 15 /f :: 下午 4 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 16 /f :: 下午 5 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 17 /f :: 下午 6 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 18 /f :: 下午 7 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 19 /f :: 下午 8 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 20 /f :: 下午 9 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 21 /f :: 下午 10 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 22 /f :: 下午 11 點 reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 23 /f
PowerShell
# 共通: 建立機碼 New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null # 選項 (只使用其中一個) # 上午 12 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 0 -Force | Out-Null # 上午 1 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 1 -Force | Out-Null # 上午 2 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 2 -Force | Out-Null # 上午 3 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 3 -Force | Out-Null # 上午 4 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 4 -Force | Out-Null # 上午 5 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 5 -Force | Out-Null # 上午 6 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 6 -Force | Out-Null # 上午 7 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 7 -Force | Out-Null # 上午 8 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 8 -Force | Out-Null # 上午 9 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 9 -Force | Out-Null # 上午 10 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 10 -Force | Out-Null # 上午 11 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 11 -Force | Out-Null # 下午 12 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 12 -Force | Out-Null # 下午 1 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 13 -Force | Out-Null # 下午 2 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 14 -Force | Out-Null # 下午 3 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 15 -Force | Out-Null # 下午 4 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 16 -Force | Out-Null # 下午 5 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 17 -Force | Out-Null # 下午 6 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 18 -Force | Out-Null # 下午 7 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 19 -Force | Out-Null # 下午 8 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 20 -Force | Out-Null # 下午 9 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 21 -Force | Out-Null # 下午 10 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 22 -Force | Out-Null # 下午 11 點 New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 23 -Force | Out-Null