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 does the same thing as manually disabling and re-enabling the device in Device Manager — and that's very likely the same as physically unplugging and replugging the device, though that part hasn't actually been tested.

Step 1—Download DevCon

Download and install the "devcon" utility from Microsoft. The example below uses a 32-bit installation, with devcon extracted to an "i386" folder — adjust the path to match wherever you install it.

Step 2—Find the hardware ID

  1. Open Device Manager (Win+X → Device Manager)
  2. Locate your target USB device (may appear under Ports, under "Astroimaging equipment" — as is the case for some QHY cameras — or elsewhere, depending on the driver)
  3. Double-click the device and go to the Details tab
  4. In the Property dropdown, select Hardware Ids
  5. Note the first ID—it will look like: USB\VID_16C0&PID_09B0
Device Manager—locating the USB device Device Manager—Hardware IDs in Properties

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*"

Important: No program should be using the device for this to work. In Seletek's case, that means closing all Seletek software before running this batch file.

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 — and it's a good bet that this, in turn, is the same as a physical unplug and replug, though that's never actually been put to the test. Either way, this method is far more comfortable than resetting the whole computer.