This PowerShell script was designed to restart a Toshiba external Canvio Desk 2TB 3.5'' hard drive device that has a faulty connection to a Windows 10 OS. It can be generalized for any USB device exhibitingconnections problems, however. In this particular case, the problem could be either hardware-related (such as faulty or damaged data or power cables) or software-related. Interestingly, the issue does not seem to manifest on Linux OS distros, suggesting it might be software-related.
- Open the Device Manager. You can do this by typing "Device Manager" into the search bar on the taskbar and selecting the application from the list that appears.
- In the Device Manager, look for the device that is having problems. It might have a yellow, trianglular "Warning ⚠" icon next to it.
- Right-click on the device and select "Browse my computer for drivers" (bottom option).
- Select "Let me pick from a list of available drivers on my computer" (bottom option).
- The single, correct driver should be selected by default. Click "Next", to update it with 'itself' and then "Close".
- Replace the
deviceInstanceIdin the script with the actual Device Instance ID of your device. - Run the script.
There are two methods to find the Device Instance ID:
-
Open the Device Manager. You can do this by typing "Device Manager" into the search bar on the taskbar and selecting the application from the list that appears.
-
In the Device Manager, look for the device that is having problems. It might have a yellow, trianglular "Warning ⚠" icon next to it.
-
Right-click on the device and select "Properties".
-
In the Properties window, go to the "Details" tab.
-
In the "Properties" dropdown menu, select "Device instance path". The value that appears in the "Value" field is the Device Instance ID.
-
(Confirmation) Go to the "Events" tab. The Device Instance ID should also appear here, along with a description of any problems the device is experiencing. Look for events with descriptions such as "Device configured" or "Device not started".
- Use the
pnputil.exe /enum-devices /class USB /problemcommand in your terminal. This command lists only USB devices that are encountering problems. By manually combing through the output, you can verify the results yourself. This manual verification provides a greater sense of reliability and trust in the result. - From the output, copy only the value of the
Instance ID:field. Replace thedeviceInstanceIdin the script with the value you found. This manual process allows for human verification, ensuring the accuracy of the Device Instance ID.
- Simply run the
Restart_usb_ext_hdd_device.ps1script and it will automatically search for the Device Instance ID of the wanted, problematic device, if there is one. This method is the most convenient and efficient, as it automates the entire process for you. - To do so, open up PowerShell and navigate to the directory where the script is located. Then, run the script by typing
.\Restart_usb_ext_hdd_device.ps1and pressing Enter.
The script uses the pnputil.exe /restart-device command to restart the specified device, effectively resetting the connection and potentially resolving any issues.