IDM is a convenient browser download tool in Windows, but as the download records gradually accumulate, they can only be deleted by selecting them through the interface. Is there an automated method to automatically clear the download history at shutdown? Below is a method to automatically clear the download history using PowerShell.

1. Create IDM-remove-history.ps1

Create a PowerShell script to clear the download history.

$key = '\d+'
Get-ItemProperty 'HKCU:\SOFTWARE\DownloadManager\*' | Where-Object {$_.PSChildName -match $key} | Select-Object PSPath | remove-item -recurse -verbose

Logic: Remove all entries with numerical names under the registry key HKEY_CURRENT_USER\Software\DownloadManager. IDM stores its download history in the registry with random names.

▼ Execution

powershell IDM-remove-history.ps1

2. PowerShell Permissions Setting

  1. If you encounter the error “cannot be loaded because running scripts is disabled on this system.” it means that script execution is not permitted.
  2. Solution: Run Set-ExecutionPolicy RemoteSigned to allow scripts to execute without a digital signature.

💡 解說文章(繁體中文): https://jdev.tw/blog/8847/
💡 Explanation article(English)
💡 解説記事(日本語)

✅ Reference: TRUE Internet Download Manager IDM download history cleaner. : r/Sharingware
✅ Reference: 方法 to Clear Windows Usage Records