PnPUtil - Show Hidden devices in cmd call

Nick 0 Reputation points
2024-12-06T20:59:35.66+00:00

Hi,

Recently I've been experiencing an issue wherein my PC doesn't detect my graphics card. Using the windows device manager to "scan for hardware changes" will sometimes resolve this, but sometimes this fix won't work unless I toggle on "View -> Show Hidden Devices". In these cases, I might "scan for hardware changes" multiple times with no success, and then repeat that with "Show Hidden Devices" activated and solve the issue right away.

I was wondering if this functionality can be mimicked in a call from CMD. I'd like to not have to open device manager every time I start my PC, so I wrote a .bat script (that runs as administrator) to automate this process by just calling pnputil.exe /scan-devices.

Is there a flag or option to include hidden devices in this scan? I can't find anything like this in the PnPUtil command syntax. Or what else might be causing the discrepancy between calling PnPUtil from the command line versus from the UI application?

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,651 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erik Moreau 821 Reputation points MVP
    2024-12-07T10:18:01.5366667+00:00

    Hi Nick,

    You should be able to trigger the same effect by restarting the Windows Management Instrumentation (WMI) service, this should also trigger a pnp re-detect

    The command to do this:

    net stop winmgmt && net start winmgmt

    hope this helps,

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.