2010
04.11

This is an old post from one of my old sites, but since people still seem to have this issue I decided to re-post it here. Below are some solutions problems you might experience with USB devices in Windows XP, especially so when the computers resumes from S1/S3 standby or hibernation. However, these tricks can be applied to most any USB device giving you grief and in need of resetting. A reset of a device is very tricky to automate, so these steps aren’t pretty. At all. Never the less, if you’re reading this you probably don’t care, right? OK, so let’s get down to it.

PLEASE READ
In many cases, the problem is exactly what Windows is telling you. If you get an error about a device exceeding it’s power limits, that might be precisely what is happening.
Power hungry devices like external hard drives, coffee warmers, vibrators and alike require more power than what an USB port can supply. In these cases, none of the below will help. What you need then is a product like a powered USB Hub to help power the device.
A hub will probably solve the problem for 90% of you. If you know this isn’t the case, read on.

PLEASE READ #2:
Off course I won’t take responsibility for something you mess up. So if you are thinking of suing me because you wiped out your hard drive attempting the below, tough luck. Won’t happen.

Step 1: Getting XP to shut up about device problems. In my case, I got this in my face every time resuming the computer from standby: A USB device has exceeded the power limits of its hub port. For assistance in solving this problem, click this message. Annoying, since it in my case is total bullshit. To get rid of messages like this (and we really really want to don’t we?) open the device manager (start menu -> run -> devmgmt.msc). Now, expand the USB group at the bottom of the list and double-click any “Universal Host Controller”. Click the “Advanced”-tab, and check the “Don’t tell me about USB problems” option at the bottom. Click OK and close the device manager.

Now, this might be enough for some of you. If you’re not using the port windows is nagging about then go to the fridge and grab a beer because this is all you have to do in order to shut it up. However, the port/device will still be disabled. If you do need the port/device and still feel eternally damned, read on.

Step 2: Reset USB device/port. This is the tricky and really really ugly part, so lock up you children and pet your dog before proceeding. For this we need a little application called devcon from MS. Grab it and put it in C:\Windows (or any other place, but we’ll use this in our examples below). Then, open the device manager (start menu -> run -> devmgmt.msc).
What we need to do now is find out which hub (port) our troubled device is connected to. To do this, expand the USB group at the bottom of the list. In sequence, open every “USB Root Hub” and click the “Power”-tab to see if your device is listed there.

When you have found the hub that has your device listed, click the “Details”-tab. Write down the name shown in the list between the first and second \-sign, for example “ROOT_HUB20”, on a piece of paper.

In the example above it’s the “USB Mass Storage Device” that keeps shutting down, and by doing the above we found out it’s connected to ROOT_HUB20.
Next, start a Command Prompt (start menu -> run -> cmd). Type in the following, replacing ROOT_HUB20 with what you wrote down on your paper.

C:\>devcon remove *ROOT_HUB20*
USB\ROOT_HUB20\4&32FF5014&0 : Removed
1 device(s) removed.

C:\>devcon rescan
Scanning for new hardware.
Scanning completed.

Now windows should remove and re-detect the hub and any eventual devices attached to it, re-enabling them in the process. If not, you probably got the wrong hub. Redo the above steps until it works.

Great, now we’ve managed to reset the device. Let’s do a batch file outta this so we don’t have to poke around manually every time we need a reset. Open notepad (start menu -> run -> notepad) and put in the following (replace ROOT_HUB20 as above):

@ECHO OFF
C:\WINDOWS\devcon remove *ROOT_HUB20*
C:\WINDOWS\devcon rescan

Go to the “File”-menu, choose “Save”. In the “File name”-field, enter “C:\WINDOWS\usbreset.bat” (yes, without the “‘s) and click “Save”.
If you’re not experiencing your problems particularly when windows resumes from standby, this is probably the end of the line. Just put a shortcut to the batch file on your desktop or do start menu -> run -> usbreset whenever you want to reset the device. However, if you are having the problems on resume and still feel somewhat damned, read on.

Step 3: Automating it. We’re getting closer. Can you feel it? We need some more stuff for this next step, namely a sleep command and Nate DeSimone’s neat Hibernate Trigger. Put sleep.exe in C:\Windows to start with. We now need to edit our batch-file again as below (start menu -> run -> notepad C:\WINDOWS\usbreset.bat):

@ECHO OFF
C:\WINDOWS\sleep 5
C:\WINDOWS\devcon remove *ROOT_HUB20*
C:\WINDOWS\sleep 2
C:\WINDOWS\devcon rescan

The sleep’s are there to cut the hardware some slack when waking up all dazed and confused. I wouldn’t mind something like that myself in the morning. Anyways, save the batch-file (CTRL-S) and then install Hibernate Trigger we just downloaded. During install, choose to have it start with windows.

After completing install, start the program from your start-menu. On the second line (wakeup command) input “C:\WINDOWS\usbreset.bat” (yes, without the “‘s). Check the minimize box and then minimize the application. This should be it! Try sedating the machine, wake it, get upset when it isn’t working, fiddle around some more and then finally go get yourself a beer when you got it working.

Visitor contributed thoughts:

MB: Very much the same with not extra sw. make the following file (change Dev ID)

C:\sleep.bat

———————————

RUNDLL32.EXE PowrProf.Dll,SetSuspendState
devcon remove USB\\VID_0424*
devcon rescan

———————————-

Then setup a schudled task when the system has been idle x amount of time (hibernate needs to be switched off).

Edwin: Was only not so charmed about the Hibernate Trigger progam, but used the Vista native Task Scheduler instead:

Create Task -> Triggers -> New -> On an event -> Log: System -> Source: Power-Troubleshooter -> Event ID: 1

Also tick “Run with highest privileges” at the General tab.

And next select your batchfile at the actions tab.

Evaldas Jocys: You don’t need sleep.exe to add delays, use ping command instead.
You can reset multiple devices by calling :ResetUsb function with parameter (%1).
—————————————-

@ECHO OFF
:: What we need to do now is find out which hub (port) our troubled device is connected to.
:: 1. Open the device manager (start menu -> run -> devmgmt.msc).
:: 2. Expand the \”Universal Serial Bus controllers\” at the bottom of the list.
:: 3. In sequence, open every \”USB Root Hub\” and click the [Power] tab to see if your device is listed there.
:: 4. When you have found the hub that has your device listed, click the [Details] tab.
:: 5. Write down the name shown in the list between the first and second \\-sign, for example “ROOT_HUB20”
:: 6. Add CALL :ResetUsb *ROOT_HUB20* here … (you can add as many lines as you want…)
::CALL :ResetUsb *ROOT_HUB20*
CALL :ResetUsb *ROOT_HUB20*
GOTO:EOF

:ResetUsb
:: Delay for 5 seconds.
ping 1.0.0.0 -n 1 -w 5000 > nul
devcon remove %1
:: Delay for 2 seconds.
ping 1.0.0.0 -n 1 -w 2000 > nul
devcon rescan
GOTO:EOF

2010
04.09

If you’re like me and keeping track of your movie collection by IMDB ID’s this is a painless way of importing them into the excellent “My Movies” plugin for Media Center.

  1. Create a working directory on your machine.
  2. Create a text file, call it “file.txt” and add your IMDB ID’s one per line, preserving the “tt”-prefix, ie. “tt0076729”.
  3. Create another text file, name it whatever you like and add the following two lines:

    for /f “tokens=*” %%i in (file.txt) do @echo off> %%i.mkv
    for %%a in (*) do (md “%%~Na” && move “%%a” “%%~Na”)

  4. Rename the text file you just created and change the extension to .bat. Run it. This step will create a bunch of directories with the IMDB ID’s.
  5. Start the “Collection Manager” included with “My Movies”.
  6. File menu->Import->Folder content. Point it to your working folder and sit back while it builds your database.
2010
04.09

I previously had a PCTel HSP56 PCI modem in my Tapirex server for monitoring Caller ID, but moving the machine to a VMWare client made me look for alternatives after testing the modem with VMDirectPath and realizing it didn’t work with that modem (BTW, here are my Patched PCTel drivers that will enable CID if anyone needs it).

Now, after reading some forums it seemed the Zoom modem would work so I went ahead and ordered it from Expansys. I then attached it to my Silex USB-over-ethernet hub and mounted it on the Windows 7 client (all though the fact that it’s attached to a VMWare client in this way doesn’t really make any difference, it would be just the same scenario when plugged directly into a physical machine).

So, first off; enable CID on the Zoom. This is done by using a terminal program and sending the “at+vcid=1” command followed by “at&w” to save it to the modem firmware. Alternatively, it would probably suffice to add “at+vcid=1” to the “Extra initialization commands” of the modem (Device Manager->Modem->Advanced).

Now, this should be all but I still couldn’t get it to work. Since I’m using a VoIP box to push internet telephony into my existing phone lines, I do however have the possibility to fiddle around with the CID sequence that is presented to the modem a bit more than your average Joe. And behold, turns out the Zoom modem does not pick up on DTMF signals at all (this CID standard is used here in Sweden and other places as well). When it was changed to Bellcore (US, china, etc) the modem immediately picked up on the signal. Luckily for me I could change this in my PAP2 VoIP box, and it also turned out that my other CID enabled devices on the phone line could handle Bellcore. If you are not in the position where you can change this (ie. on a normal land line) and in a country that uses anything but Bellcore I guess you’re out of luck until Zoom fixes this in their drivers or firmware.

Here are the device settings for the Zoom modem in Tapirex:

2010
04.09

I recently bought a Silex Sx-3000GB (or “SILEX USB 2.0 SERVER FOR NETWORK” as my store called it) for use with two WD MyBook drives and some other stuff on a Windows 7 guest OS. The initial setup went fine, even though it installs a tray app for the logged in user (didn’t bother me at the time since I always have a user logged on anyway). However, I soon started seeing some strange behavior as the disks were constantly connecting and disconnecting/reconnecting. The solutions turned out to be installing the software as a service. Here we go:

  1. You need instsrv.exe and Srvany.exe, these are part of the “Windows 2003 Resource Kit” (http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en) and installs on W7 as well. Put them in %WINDIR%\system32.
  2. Open cmd. Execute “instsrv SXVirtualLinkStarter %WINDIR%\system32\srvany.exe”.
  3. Start regedit and go to “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SXVirtualLinkStarter”.
  4. Create a new key and call it “Parameters”.
  5. In Parameters, create two new Strings. “AppDirectory” with data “C:\Program Files\silex technology\SX-Virtual Link” and “Application” with data “C:\Program Files\silex technology\SX-Virtual Link\connect.exe”. Adjust the paths accordingly.
  6. You now have a new Service, make sure it runs as the same user as the one used to access the hardware and set it to start automatically if desired. Keep in mind you cannot use the Silex software UI as long as the service is running, so if you need to change any settings; stop the service, start the app as normal and save your settings, close the app and restart the service.

I’ve had it setup this way and running smoothly for a few weeks now. Even though the Silex device is not very fast (I average about 8MB/s both read and write) the disks feel fairly snappy and seems to produce OK access times. This guide should also work on other Server based OS’s (2003/2008). If the connect/disconnect issue is related to the OS running on VMWare I do not know, however this can be done on any “normal” Windows install as well. It should also work for other Silex devices using the same “SX-Virtual Link” software.

On a final note, I learned that older Silex devices are compatible with the Belkin USB servers and that the Belkin software could be used instead. The Belkin software is said not to have the disconnect problems but it did not work with the SX-3000GB.