IDM是Windows裡很方便的瀏覽器下載工具,但當下載的記錄在日積月累下,逐漸增加,只能透過使用介面選取後再刪除,有沒有自動化的操作方法,在關機時自動清除下載歷史呢?以下是透過PowerShell來達成自動清除下載記錄的方法。
1. 建立IDM-remove-history.ps1
建立清除下載歷史的PowerShell腳本。
$key = '\d+'
Get-ItemProperty 'HKCU:\SOFTWARE\DownloadManager\*' | Where-Object {$_.PSChildName -match $key} | Select-Object PSPath | remove-item -recurse -verbose
邏輯說明:將登錄 \HKEY_CURRENT_USER\Software\DownloadManager\下所有數字的登錄皆刪除掉。IDM的下載記錄是存放在登錄內,以亂數為名稱。
▼ 執行
powershell IDM-remove-history.ps1
2. PowerShell權限設定
- 執行時若出現
cannot be loaded because running scripts is disabled on this system.表示沒有PowerShell的執行權限 - 解決方法: 執行
Set-ExecutionPolicy RemoteSigned以設定為不需要數位簽章就可以執行。。
3. 💡 相關鏈接
💡 解說文章(繁體中文): https://jdev.tw/blog/8847/
💡 Explanation article(English)
✅參考:TRUE Internet Download Manager IDM download history cleaner. : r/Sharingware
✅ 參考:Windows抹除使用記錄的方法
##