Bypassing "Found New Hardware Wizard" / Setting Windows to Install Drivers Automatically

I finally got Windows XP working on my new old system on Friday! Woohoo! (It only took 5½ months.)

I would state the specific steps required to fix it in case someone else encounters a similar problem, though unfortunately, due to growing frustration and impatience, I ended up taking a somewhat scorched-earth approach and performed multiple steps at a time. However, I did keep the working files I used, and ferreted out the changes I made, so I will list several things to try that will, or at least should help.

(Obviously this is advanced stuff for advanced users; though even advanced users can mess this up pretty badly, hence the initial backup step.)


To recap the problem, a hard-drive containing an existing installation of Windows is put into a new system, and Windows does not automatically install drivers for hardware and prompts the user to install unsigned drivers, even for drivers that are supposed to be signed. Further, the user is unable to accept the dialog(s) because Windows has not installed the drivers for the keyboard or mouse (or other input devices).


Here is the tl;rd version:

  1. Make a backup of the registry hives.
  2. Disable every program, driver, and service that you can.
  3. Set things (like the taskbar) so that you can see everything (don’t hide any info).
  4. Have a .BAT file auto-run to have an easy way to make changes and perform online (in-OS) tasks.
  5. Use a macro/scripting app to automate key-presses and button-clicks since you can’t do it yourself.
  6. Make sure all system files are present.
  7. Manually remove problematic and no-longer-present hardware.

  1. :

    • Boot into (pure) DOS or other OS, and make a backup copy of the registry hives to another location. This includes %systemroot%\System32\CONFIG\* and %userprofile%\NTUSER.DAT

    • Make sure that drive/partition settings in BOOT.INI and SystemBootDevice in [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet00*\Control] are set correctly since your system drive may now be on a different drive/partition than it used to be (in my case, the (r)disk used to be 0, but was now 1 because of the new drive).

  2. :

    • Mount the appropriate registry hives and disable any and all extraneous auto-run programs, particularly anything that throws up windows and stuff that obscure your view since you won’t be able to minimize them or click the other windows/dialogs to the front (you must simplify to troubleshoot a problem like this). You don’t have to delete the auto-run entries, you can disable them instead, so that they’re still there for when you get Windows running and want to auto-run them again (especially for entries that have a bunch of command-line arguments):

      • For the Run keys, you can simply toss in a # character or something at the beginning of the command. That way, Windows won’t be able to run it since it’s not a valid file and will ignore it.

      • Mount the SYSTEM hive and set the start parameter to disabled (dword:4) for any extraneous drivers and services (especially those for hardware that is no longer present).

      • Disable PageDefrag, etc. in BootExecute in …\Control\Session Manager by adding a # to the beginning of the command (though leave autocheck alone since you’ll want the drives checked/fixed if you end up having to reboot via the reset button).

      • Instead of deleting any shortcuts in the Startup folders, just move them somewhere else.  

    • Set Windows to install drivers regardless of driver-signing by mounting the SOFTWARE and NTUSER registry hives and setting \Software\Microsoft\Driver Signing and \Software\Microsoft\Non-Driver Signing to BIN:00.

  3. :

    • You’ll want to see the taskbar and notification area, so turn on topmost and turn off autohide by mounting NTUSER and editing \Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2 to set the 9th byte so that bit 0 is off and bit 1 is on (0x7A will show the maximum information). Also, disable any other taskbar consolidation/manipulation programs such as PCMag’s TrayManager (maybe you got it before they started selling their utilities).
  4. :

    • Mount the SOFTWARE hive and add an auto-run entry to run a .BAT file on startup (for no reason, I called mine C:\t\j.BAT). Now you can easily get Windows to do things without having any direct input. Granted, it requires a reboot to another OS, modification of the batch file, and booting Windows again to make a change, but it’s better than having no way of doing anything in Windows whatsoever. ;-) (You can comment out stuff instead of just deleting them.) Add a command at the end of the batch file to reboot Windows, eg shutdown -t 10 -r. Don’t forget that or else you’ll end up having to press the reset button!

    • In your batch file (eg j.bat), perform certain actions like importing any .REG files (which you can edit offline, in another OS just like you can with your batch file). Have the batch file run Device Manager and maximize the window (with a tool such as Nircmd) to give yourself an opportunity to view the current state of the hardware. (Try using a command-line tool like QRes to set the resolution to the maximum your video driver—which may be the generic VGA adapter at this point—can do, eg 1024x768.) You can also re-register .DLL files to fix some problems, especially those related to Windows Update.

    • You don’t want the batch file to run quickly and crazily, so you’ll want to get a command-line tool that can pause for a given number of seconds in order to pause script execution—no, the pause command is no good since it requires pressing a key to continue. (I used a program I wrote years ago, but there are plenty available on the Internet, or just use a common hack.)

  5. :

    • Get a macro-recorder/scripting app like HotkeyMaster, WinMacro, MacroMaker, AutoHotkey, AutoIt!, etc. and configure it to perform whatever keyboard or mouse actions you need (this way you can “do” things in Windows without actually having any input devices available). You’ll want to configure it to detect certain windows or dialog boxes by title and/or class and/or control and perform certain mouse-clicks or key-presses accordingly. For example, you can have it automatically detect the driver confirmation dialogs and trigger a click on the Next or Continue buttons. (Make sure to set the macro app to run on startup instead of in the .BAT file to make sure that they are running by the time that Windows detects the hardware and starts prompting for drivers; alternately, have them run at the beginning of the batch file using the start command to avoid the batch file being blocked on them since they will not be quitting.)
  6. :

    • Ensure that all of the required system files are in place. Run (via the batch file) sfc /scannow. Make sure to have your Windows disc in the drive—assuming that Windows even has the CD/DVD drivers installed. You can also try manually copying any missing files while offline. For example, I copied all of the files from my last backup of XP, specifying to not overwrite files that exist. That way, any missing files were restored (especially in the following directories:

      • C:\Windows
      • C:\Windows\INF
      • C:\Windows\Driver Cache
      • C:\Windows\ServicePackFiles
      • C:\Windows\System32
      • C:\Windows\System32\dllcache
      • C:\Windows\System32\Drivers

      • (I also happened to restore the following non-hardware-installation related directories not long before it finally started working again. Coincidence? I don’t know.)

      • C:\Windows\Assembly
      • C:\Windows\Microsoft.NET
      • C:\Windows\WinSxS
      • C:\Windows\Help
      • C:\Windows\System32\WBEM

      • (You may actually want to delete or rename C:\Windows\System32\CatRoot*)

  7. :

    • Delete all of the .PNF files in C:\Windows\INF. Windows will rebuild them from the existing .INF files the next time it needs to install a driver (which at this point is still at every boot). This is similar to clearing the browser cache when a page isn’t displaying correctly, in order to ensure that you are getting and using the most up-to-date copy of the files.

    • As a last resort, get and use the Microsoft tool DEVCON to remove certain devices so that Windows can try installing the hardware from scratch. First however, you’ll want to run the command (via your batch file) DEVCON findall * > C:\t\devcon.log to dump a list of all of your hardware and their corresponding IDs. That way, you can compile a proper, and custom list of what hardware you want to remove. Devices of note to remove include the following:

      • "*ACPI*"
      • "USB\ROOT_HUB*"
      • "SERENUM\MOUSE*"
      • "VEN_8086"
      • "HID*"
      • "*TUNMP*"
      • "PCI\VEN_1102*"
      • "PCI\VEN_1033*"
      • "PCI\VEN_1011*"
      • "PCI\VEN_1186*"
      • "PCI\VEN_11AB*"
      • "PCI\VEN_1274*"
      • "PCI\VEN_5333*"

      • (These are the main, motherboard related devices such as processors, ports, buses, input devices, network cards, hard drives, and optical drives.)


As you can see, it’s (not surprisingly) a huge pain to get Windows running again if you plunk your system drive into a new system (read motherboard) and want to avoid having to reinstall. Having no method of input makes it very difficult, but not impossible. It takes a lot of time, effort, patience, tools, attention to detail, and caution, but it is possible, and the rewards (putting off a complete re-installation and thus losing who-knows how many thousands of customizations made over time) can be worth it.

Fortunately, I finally managed to get it working because I’m not ready to just up and reinstall. Now I can not only use Outlook Express again (and download and purge the 5,000 or so emails that had piled up in my accounts), but I can do some programming again in my installed copy of good old VS2003. (Not that I wasn’t getting used to Windows 7; in fact for a little while, I felt weird back in XP, but I’m feeling at home again, like moving into a dormitory for a year, then moving back into your bedroom at home.)