Scans and removes ghost devices left behind by previously connected hardware — reducing IRQ overhead, lowering input latency, and making input smoother. Everything runs natively through Windows built-in tools. It is safe, and non-destructive.
- Ghost devices are phantom registry entries from hardware that is no longer connected.
- They silently consume IRQ resources and can cause input stutter, slower USB initialization, and driver conflicts.
Note
Not sure what it does? Check the video preview to see it in action. the whole process takes under 10 seconds.
📸 Screenshots
Scan results — ghost devices detected and listed, protected devices preserved
All detected devices are displayed with their status. Ghost devices (
GHOST) are pre-checked and ready for removal. Devices with CPU affinity / IRQ pinning (AFFINITY CONFIGURED) are listed separately and unchecked by default.
Confirm removal — one-click removal with confirmation dialog
Before any deletion, a confirmation popup displays the exact number of devices to be removed. The action cannot be undone through this tool — though devices will re-appear if the hardware is reconnected.
After removal — clean state, only protected devices remain
After removal, the tool automatically re-scans. Ghost count drops to
0, removed count updates to reflect the session total. OnlyAFFINITY CONFIGUREDdevices remain, fully intact.
Every time you plug in a peripheral — mouse, keyboard, USB hub, headset — Windows registers it. When you unplug it, the entry stays. Over time, these stale entries pile up silently in the registry, consuming IRQ resources and creating noise in the device enumeration process.
Device Cleanup scans every registered device on your system, identifies the ones no longer physically present, and removes them in a single operation. The result is a cleaner interrupt table, faster USB initialization, and smoother input — with zero guesswork.
All changes are limited to phantom entries. Active devices and any device with CPU affinity or IRQ pinning configured are never touched. If a removed device is reconnected, Windows will simply re-detect it as new — no data is permanently lost and fully safe !
If you need any help or have questions, feel free to join the Discord support server — I'll be happy to assist you.
Download DeviceCleanup.ps1, then right-click it → "Run with PowerShell".
The script will automatically request administrator privileges.
Caution
If you are not allowed to run PowerShell scripts, enable it first:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Or refer to EnablePowerShellScript.
- Click Scan System — the tool scans all devices registered in Windows, including disconnected ones.
- Review the list — ghost devices are listed as GHOST, protected devices as AFFINITY CONFIGURED.
- Select the devices to remove (all ghosts are pre-checked by default).
- Click Remove Selected and confirm.
- The tool automatically re-scans after removal to confirm they are gone.
| Feature | Description |
|---|---|
| Ghost device scan | Detects all devices with status Unknown (Error Code 45) — hardware no longer connected. |
| Affinity protection | Automatically preserves any device with a CPU affinity / IRQ pinning configuration. |
| Safe removal | Removes ghost entries using up to 5 fallback methods — Remove-PnpDevice, pnputil, SetupAPI, reg.exe, devcon. |
| Label | Meaning |
|---|---|
GHOST |
Phantom device — previously connected, no longer present. Safe to remove. |
AFFINITY CONFIGURED |
Device has IRQ / CPU affinity pinning configured. Protected by default, removable manually. |
Important
Devices marked AFFINITY CONFIGURED are unchecked by default. Removing them will delete your IRQ affinity configuration. Only do so intentionally.
Gains scale with the number of devices removed. Results are most noticeable on systems with a large number of previously connected peripherals.
| Improvement | Details |
|---|---|
| Lower input latency | Fewer phantom IRQ entries competing for resources. |
| No IRQ conflicts | Cleaner interrupt routing across active devices. |
| Faster USB initialization | Windows no longer enumerates stale device entries. |
| Faster boot | Reduced device enumeration on startup. |
| Cleaner registry | Removes dead entries under HKLM\SYSTEM\CurrentControlSet\Enum. |
The tool attempts removal using the following methods in order, stopping at the first success:
Remove-PnpDevice— native PowerShell cmdletpnputil.exe /remove-device— Windows built-in PnP utility- SetupAPI
SetupDiRemoveDevice— direct Win32 API call, bypasses PnP manager lock reg.exe delete— brute-force registry key removaldevcon.exe remove— if present on system or in script directory
This is an improved and redesigned version of the original Device Cleanup Tool by Uwe Sieber.
Built from scratch with a modern GUI, it adds automatic protection for devices with CPU affinity / IRQ pinning configured — keeping them clearly identified and unchecked by default, so nothing gets removed by accident.
The interface also provides a clearer real-time view of what is happening at each step, making the whole process more intuitive for everyone.
©insopti — guns.lol/inso.vs | For personal use only.



