Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
69 ratings:
 3.66 out of 5     Rate this Document

How Do I Force Windows to Remove and Redetect a USB Device?

Hardware: Digital I/O (DIO)>>Static>>USB-6501, CompactDAQ, Multifunction DAQ (MIO)>>Portable

My USB device will occasionally lose connection to the computer, and I have to disconnect and then reconnect my it before it will work.  Why does this happen, and how can I get Windows to redetect the device, without having to physically disconnect the device?

This behavior occurs when the device loses power, but the computer does not.  For example, often when a computer goes into standby or power-save mode it will often shut down power to the USB ports.  Also, this can happen when a computer returns from having been hibernated.  In either case, the device is not redetected by the computer and thus you will not be able to communicate with it.  Follow the instructions below to redetect the device within Windows when this happens:
  1. Install the DevCon utility from Microsoft.  The DevCon utility is a command-line utility that acts as an alternative to Device Manager. Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices.  You can download DevCon from
  2. Open the Windows Device Manager by going to Start » Run, type in devmgmt.msc, and then click the OK button.
  3. You will now need to determine which USB hub (port) the troubled device is connected to. To do this, expand the Universal Serial Bus controllers group at the bottom of the list.

  4. In sequence, double click on every USB Root Hub entry and click the Power tab to see if your device is listed.

  5. When you have found the hub that has your device listed, click the Details tab.  Record the name shown in the list between the first and second \ sign, for example ROOT_HUB20.

  6. Next, start a Command Prompt by going to Start » Run, type in cmd, and then click the OK button.
  7. In the Command Prompt window, type in each of the following commands followed by enter, replacing ROOT_HUB20 with what you recorded in step 4.
         devcon remove *ROOT_HUB20*
         devcon rescan

  8. Now, Windows will remove and re-detect the hub and any USB devices attached to it, re-enabling them in the process. If this does not work, you probably selected the wrong hub in step 4.  Repeat steps 3 - 6 until the device works.

Related Links:
MSDN: The DevCon command-line utility functions as an alternative to Device Manager
KnowledgeBase 3D8J0A3U: USB-92xx Devices May Not Wake from Hibernation


Report Date: 12/04/2007
Last Updated: 08/21/2009
Document ID: 4G3CHJPO

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit