What DevCon does
DevCon is a command-line utility from Microsoft that lets you enable, disable, and query hardware devices from the Windows command line — the same operations as right-clicking in Device Manager, but scriptable and remote-friendly. Running a two-line batch file over Remote Desktop is equivalent to physically unplugging and replugging the device.
Step 1 — Download DevCon
DevCon is distributed as part of the Windows Driver Kit (WDK) or the Windows Hardware Lab Kit (HLK). Search for "DevCon Windows" on the Microsoft documentation site to find the current download. Extract the appropriate binary for your system (x64 for 64-bit Windows).
Step 2 — Find the hardware ID
- Open Device Manager (Win+X → Device Manager)
- Locate your target USB device (may appear under Ports, Imaging Devices, or another category)
- Double-click the device and go to the Details tab
- In the Property dropdown, select Hardware Ids
- Note the first ID — it will look like:
USB\VID_16C0&PID_09B0
Step 3 — Create the batch file
Create a .bat file with two commands — one to disable the device, one to re-enable it. Adjust the path to where you extracted DevCon, and replace the hardware ID with your device's actual ID:
c:\tools\devcon\devcon disable "USB\VID_16C0*PID_09B0*"
c:\tools\devcon\devcon enable "USB\VID_16C0*PID_09B0*"
The wildcards (*) after the VID and PID match any variant of that device, which is usually what you want.
Important: Close any software that is currently using the device before running the batch file. If a program has an active connection to the device, the disable command may fail or leave the device in an inconsistent state.
Running it remotely
Save the batch file to the observatory PC and run it via Remote Desktop, a remote management tool, or a scheduled task. You can also call it from a macro in your automation software if a device reset is needed as part of an automated recovery sequence.
The result is effectively identical to manually disabling and re-enabling the device through Device Manager — which for most USB devices is equivalent to a physical unplug and replug.
