A script to autorun a hardware scan in device manager on this machine

Jeremy Barnes 1 Reputation point
2021-03-06T22:26:07.95+00:00

https://learn.microsoft.com/en-gb/windows-hardware/drivers/devtest/devcon-rescan

This is the closest I've found, but I need a script to * autorun a hardware scan in device manager * every time the computer (the local machine, not a server-connected remote computer as in the example) start, since a soundcard systematically drops the connection after a reboot.

Thankful for help. As simple as possible, please, as I'm out of my depth already. Thank you!

Here's to refresh your synapses...

MS posted this as an example, but it refers to a different scenario (but, where the computers have the same issue): devcon rescan devcon /m:\Server01 rescan

How to adapt this code to successfully run a scan, and how to have that action trigger daily?

Example is from here: https://learn.microsoft.com/en-gb/windows-hardware/drivers/devtest/devcon-rescan

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,675 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dave Patrick 426.1K Reputation points MVP
    2021-03-06T22:38:34.97+00:00

    From the doc
    Comments
    The /m parameter must precede the operation name (rescan). Otherwise, DevCon ignores the /m parameter and scans the local computer without returning a syntax error.

    so devcon /r should do the same thing.

    --please don't forget to Accept as answer if the reply is helpful--


  2. Dave Patrick 426.1K Reputation points MVP
    2021-03-06T22:51:01.467+00:00

    I should have tried before posting. Looks like it only comes in the WDK now. Some other possibilities here for getting devcon.exe
    https://superuser.com/questions/1002950/quick-method-to-install-devcon-exe

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments