Workaround for slow Windows XP startup

Remove the extra tens of seconds of startup time caused by a USB HDD

I got a small USB HDD (Western Digital My Passport Essential) as a Christmas present. My target was to use this external drive, with two times larger capacity than the HDD in my old desktop computer, as a storage volume for automatic daily backups of the whole computer. To achieve this, the drive will be connected to the computer all the time. A scheduled task then executes NT Backup Utility which back up the hard disk on the external drive.

Such backup volume shall be formatted in NTFS format to allow NT Backup Utility to create its huge backup files (several tens of gigabytes) on it. The My Passport Essential was originally formatted in FAT32, which cannot handle files larger than 4 GB. Therefore the USB drive needed immediate reformat but this was easy.

My problem

Everything worked fine with my setup and backup task but the Windows startup was delayed by several tens of seconds if the USB hard disk was connected to the computer. (In my plan, the drive was connected all the time, so this huge delay was added to the computer's startup every time.) This extra delay occurred after the Windows XP splash screen: screen stayed blank for a long time before the welcome screen (or login screen if any).

After googling for a while I could not find any solution. I only noted that also others have similar symptoms on different Windows versions and with different hard drives while some others have computers and drives that does not have this problem. No help from web, so I had to act by myself.

My solution

My solution is to disable the USB HDD device every time before shutting down the computer and then re-enabling it again after the Windows has been started. This way the external drive is disabled during Windows startup and it does not generate any extra delays. The external drive will not be available immediately after the Windows startup but this is not a problem because the drive is used rarely, practically only by the scheduled backup task.

Manual disabling and enabling the drive using the Device Manager is not practical, so a Windows startup and shutdown script is used to do the thing automatically every time when the Windows is started or shut down. Therefore we need a command script (batch file) that enables and disables the external disk drive and its USB device. Such file is available below.

UsbStor.cmd command file (ZIP file, 525 bytes)
Download the file and extract the UsbStor.cmd to a suitable location on your computer (not on the external hard disk itself). Microsoft's devcon.exe is needed; download it from KB311272 and extract in same folder or a path directory.

To use the UsbStor.cmd command script, you must change the device instance IDs in the beginning of the file to match your USB HDD device causing the startup delay. To see the instance IDs of your drive, remove all other USB mass storage devices from your computer and then run the script from the command prompt. The instance ID beginning with USB\ is the USB device itself, and other one beginning with USBSTOR\ is the corresponding disk drive device. Both values must be carefully copied in the script file (example below).

rem Edit the two values below to match the instance IDs of your USB Mass Storage device:
set USB="USB\VID_1058&PID_0704\575845383038415339393337"
set USBSTOR="USBSTOR\DISK&VEN_WD&PROD_1600BMV_EXTERNAL&REV_1.05\575845383038415339393337&0"

After that test the script by running it with parameter /disable (i.e. usbstor /disable). If you have copied the instance IDs correctly, the script shall display two times the message "1 device(s) disabled." The USB HDD shall disappear from the My Computer window. To re-enable the drive, test command usbstor /enable: Two "1 device(s) enabled." messages must be displayed this time.

Finally start Group Policy Editor with command gpedit.msc and browse to Local Computer Policy — Computer Configuration — Windows Settings — Scripts (Startup/Shutdown). Then double-click the items Startup and Shutdown and add the UsbStor.cmd script in the list of startup and shutdown scripts. The startup shall have parameter /enable while the shutdown shall have parameter /disable.

After these steps everything have been installed. Now just restart Windows to see if the script speeds up the startup (keep the USB hard disk connected). You can also open the My Computer window immediately after the Windows startup and note that the external hard disk is missing from the list first and appears there automatically a few tens of seconds later (after the startup script has been executed).

Even more optimized solution

Running the enable/disable script every time when Windows is started and shut down creates a short delay during these operations. If the USB hard drive is used only for automated backup purposes, consider enabling the drive only when it is really needed. This can be achieved by adding the UsbStor.cmd calls to the backup command file.

Backup.cmd command file (ZIP file, 424 bytes)
An example of a batch file used for daily backups. This batch file first calls UsbStor.cmd to enable the backup HDD device, then executes two NT Backup jobs with low priority and finally disables the backup HDD again. This kind of batch file can be executed daily using the Task Scheduler. 

Note that you should use Disk Management to change the drive letter of the backup drive to the end of the alphabet before using this approach. Otherwise the drive letter of the backup drive may vary depending on the number of (other) removable storage devices (e.g. USB sticks) connected when the backup task is triggered.

 
To see PanuWorld's finest appearance, update your web browser!