How can I scan for hardware changes in Windows using the command line? I'm looking for the same functionality as right-click "Scan for Hardware Changes" in the Device Manager.

2 Answers 2


Get a copy of Microsoft's devcon utility. Then use the following to scan for new hardware:

devcon rescan

It seems that Windows 10 ships with PnPUtil.exe. Run pnputil.exe /scan-devices from administrative command prompt to scan for hardware changes.

Create a batch file with the command. Create a shortcut to the file on Desktop by selecting "Send to Desktop" option from context menu (right click) of the file. Now you can change properties of the shortcut (shortcut -> Properties -> Advanced) to always run with administrative access.

This shortcut is easily available from Windows search. So, a Win button plus few keystrokes can do the job.

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/pnputil

  • This is exactly what I was looking for. Does anyone know if there is also a PowerShell (or dotNET) equivalent for pnputil?
    – K. Frank
    Commented Nov 20, 2022 at 18:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .