Automatically hides Windows desktop icons after 10 seconds of user inactivity. OLED-friendly.
- Hides desktop icons after a configurable idle timeout
- Shows desktop icons immediately after user input
- Uses Win32 API calls through PowerShell
Add-Type - No external dependencies
- Works with the normal Windows desktop
SysListView32icon view - Lightweight polling loop, defaulting to 8 ms polling
- Windows 10 or Windows 11
- Windows PowerShell 5.1 or PowerShell 7+
Download DesktopIconAutoHide.ps1, then run it in PowerShell:
powershell.exe -ExecutionPolicy Bypass -File .\DesktopIconAutoHide.ps1Or with PowerShell 7:
pwsh.exe -ExecutionPolicy Bypass -File .\DesktopIconAutoHide.ps1The script will keep running until the PowerShell window is closed.
Edit these values near the top of DesktopIconAutoHide.ps1:
$idleSeconds = 10
$pollMs = 8| Setting | Description |
|---|---|
$idleSeconds |
How many seconds of inactivity before desktop icons are hidden |
$pollMs |
How often the script checks for input, in milliseconds |
Common polling values:
| Target | $pollMs |
|---|---|
| 60 fps-ish | 16 |
| 120 fps-ish | 8 |
| Lower CPU usage | 33 |
The default 8 ms polling is intentionally aggressive so icons reappear quickly. If your machine starts acting like it has discovered suffering, increase this value.
To run automatically when you sign in, create a scheduled task:
- Open Task Scheduler.
- Choose Create Task.
- On General, select Run only when user is logged on.
- On Triggers, add At log on.
- On Actions, add:
Program/script:
powershell.exe
Add arguments:
-ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Path\To\DesktopIconAutoHide.ps1"
Replace the path with wherever you put the script. Revolutionary stuff, paths needing to be correct.
This script finds the desktop icon list view by locating SHELLDLL_DefView under either Progman or WorkerW, then toggles the SysListView32 window with ShowWindow().
It only hides the desktop icon view. It does not delete icons, rearrange them, or perform other desktop crimes.
MIT License. See LICENSE.