目錄剪除間隔 的登錄值 PruningInterval電腦HKLM\Software\Policies\Microsoft\Windows NT\Printers

原則 ID
PruningInterval
適用範圍
電腦設定
支援的作業系統
至少需要 Windows 2000
來源
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (版本 1.0)
類別
印表機

登錄

PruningInterval

REG_DWORD電腦
啟用時的值
取決於選項值
元素
間隔:
選項
項目儲存的值
連續0
10 分鐘10
30 分鐘30
1 小時60
4 小時240
8 小時480
12 小時720
1 天1440
2 天2880
3 天4320
4 天5760
5 天7200
6 天8640
1 週10080
2 週20160
3 週30240
4 週40320
5 週50400
6 週60480
7 週70560
無限4294967295
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers]

; 選項 (只使用其中一個)
; 連續
"PruningInterval"=dword:00000000
; 10 分鐘
"PruningInterval"=dword:0000000a
; 30 分鐘
"PruningInterval"=dword:0000001e
; 1 小時
"PruningInterval"=dword:0000003c
; 4 小時
"PruningInterval"=dword:000000f0
; 8 小時
"PruningInterval"=dword:000001e0
; 12 小時
"PruningInterval"=dword:000002d0
; 1 天
"PruningInterval"=dword:000005a0
; 2 天
"PruningInterval"=dword:00000b40
; 3 天
"PruningInterval"=dword:000010e0
; 4 天
"PruningInterval"=dword:00001680
; 5 天
"PruningInterval"=dword:00001c20
; 6 天
"PruningInterval"=dword:000021c0
; 1 週
"PruningInterval"=dword:00002760
; 2 週
"PruningInterval"=dword:00004ec0
; 3 週
"PruningInterval"=dword:00007620
; 4 週
"PruningInterval"=dword:00009d80
; 5 週
"PruningInterval"=dword:0000c4e0
; 6 週
"PruningInterval"=dword:0000ec40
; 7 週
"PruningInterval"=dword:000113a0
; 無限
"PruningInterval"=dword:ffffffff
CMD
:: 選項 (只使用其中一個)

:: 連續
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 0 /f
:: 10 分鐘
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 10 /f
:: 30 分鐘
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 30 /f
:: 1 小時
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 60 /f
:: 4 小時
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 240 /f
:: 8 小時
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 480 /f
:: 12 小時
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 720 /f
:: 1 天
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 1440 /f
:: 2 天
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 2880 /f
:: 3 天
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 4320 /f
:: 4 天
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 5760 /f
:: 5 天
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 7200 /f
:: 6 天
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 8640 /f
:: 1 週
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 10080 /f
:: 2 週
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 20160 /f
:: 3 週
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 30240 /f
:: 4 週
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 40320 /f
:: 5 週
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 50400 /f
:: 6 週
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 60480 /f
:: 7 週
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 70560 /f
:: 無限
reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers" /v "PruningInterval" /t REG_DWORD /d 4294967295 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Force | Out-Null

# 選項 (只使用其中一個)
# 連續
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 0 -Force | Out-Null
# 10 分鐘
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 10 -Force | Out-Null
# 30 分鐘
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 30 -Force | Out-Null
# 1 小時
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 60 -Force | Out-Null
# 4 小時
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 240 -Force | Out-Null
# 8 小時
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 480 -Force | Out-Null
# 12 小時
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 720 -Force | Out-Null
# 1 天
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 1440 -Force | Out-Null
# 2 天
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 2880 -Force | Out-Null
# 3 天
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 4320 -Force | Out-Null
# 4 天
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 5760 -Force | Out-Null
# 5 天
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 7200 -Force | Out-Null
# 6 天
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 8640 -Force | Out-Null
# 1 週
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 10080 -Force | Out-Null
# 2 週
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 20160 -Force | Out-Null
# 3 週
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 30240 -Force | Out-Null
# 4 週
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 40320 -Force | Out-Null
# 5 週
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 50400 -Force | Out-Null
# 6 週
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 60480 -Force | Out-Null
# 7 週
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 70560 -Force | Out-Null
# 無限
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Printers' -Name 'PruningInterval' -PropertyType DWord -Value 4294967295 -Force | Out-Null