Bypassing "Found New Hardware Wizard" / Setting Windows to Install Drivers Automatically
My motherboard finally died after the better part of a decade, so I bought a used system. I put my old hard-drive and sound-card in the new system, and connected my old keyboard and mouse (the rest of the components—CPU, RAM, mobo, video card—are from the new system).
I knew beforehand that it would be a challenge to get Windows to boot and install drivers for the new hardware (particularly since the foundational components are new), but I am completely unable to even attempt to get through the work of installing drivers for things like the video card because the keyboard and mouse won't work (they do work, in the BIOS screen, in DOS mode, in Windows 7, in XP's boot menu, etc., just not in Windows XP itself).
Whenever I try to boot XP (in normal or safe mode), I get a bunch of balloons popping up for all the new hardware detected, and a New Hardware Found Wizard for Processor (obviously it has to install drivers for the lowest-level components on up). Unfortunately I cannot click Next since the keyboard and mouse won't work yet because the motherboard drivers (for the PS/2 or USB ports) are not yet installed. I even tried a serial mouse, but to no avail—again, it does work in DOS, 7, etc., but not XP because it doesn't have the serial port driver installed.
I tried mounting the SOFTWARE and SYSTEM hives under Windows 7 in order to manually set the "unsigned drivers warning" to ignore (using both of the driver-signing policy settings that I found references to). That didn't work; I still get the wizard.
They are not even fancy, proprietary, third-party, or unsigned drivers. They are drivers that come with Windows—as the drivers for CPU, RAM, IDE controller, etc. tend to be. And the keyboard and mouse drivers are the generic ones at that (but like I said, those are irrelevant since the drivers for the ports that they are connected to are not yet installed).
Obviously at some point in time over the past several years, a setting got changed to make Windows always prompt me when it detects new hardware. (It was also configured to show the Shutdown Event Tracker on abnormal shutdowns, so I had to turn that off so that I could even see the desktop.)
Oh, and I tried deleting all of the PNF files so that they get regenerated, but that too did not help.
Does anyone know how I can reset Windows to at least try to automatically install drivers for new hardware before prompting me if it fails? Conversely, does anyone know how exactly one turns off automatic driver installation (and prompt with the wizard)?
Thanks a lot.
Just to be clear since it will likely come up in the answers otherwise, I am NOT talking about the dialog below, I am talking about the one below that.
Oh, and to head off any suggestions of the following sort before they happen, using Device Manager to disable, uninstall, repair, etc. any devices is out of the question because if the keyboard and mouse (or any other input device) isn't installed/working, then how exactly would I perform any actions like using Device Manager?
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:
- Make a backup of the registry hives.
- Disable every program, driver, and service that you can.
- Set things (like the taskbar) so that you can see everything (don’t hide any info).
- Have a .BAT file auto-run to have an easy way to make changes and perform online (in-OS) tasks.
- Use a macro/scripting app to automate key-presses and button-clicks since you can’t do it yourself.
- Make sure all system files are present.
- Manually remove problematic and no-longer-present hardware.
-
:
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).
-
:
-
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 leaveautocheck
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.
-
-
:
- 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).
- You’ll want to see the taskbar and notification area, so turn on topmost and turn off autohide by mounting NTUSER and editing
-
:
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, egshutdown -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.)
-
:
- 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
orContinue
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 thestart
command to avoid the batch file being blocked on them since they will not be quitting.)
- 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
-
:
-
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*)
-
-
:
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.)
I'll share my answer from here, script is correctly displayed in MSFN site: http://www.msfn.org/board/topic/49514-disable-found-new-hardware-wizard/?do=findComment&comment=1132792
I made an AutoIt3 script https://www.autoitscript.com/site/autoit/downloads/ which would continue with all New Hardware Wizard windows accepting non signed drivers, Cancelling WinXP CD prompts and skipping multiple options (connect to internet, etc), so as to get Mouse and Keyboard detected and installed. The compiled autoit script EXE should be copied to the "Start" (within "Start Menu") folder to be automatically executed. The script strings MUST be adapted to the local windows language. And probably some Alt-LETTER combinations too. My sample works in SPANISH WinXP. Hope it helps somebody else, after having mouse and keyboard functioning, script must be deleted (or moved to other folder):
$asistente= "Asistente para hardware nuevo encontrado" ;"Found New Hardware Wizard"
$instalacion= "Instalación de hardware"
$archivos= "Archivos necesarios"
$cambio= "Cambio de configuración del sistema"
while 1
sleep(200)
if WinExists( $cambio) then
WinActivate( $cambio)
sleep(200)
Send("!n") ; (press Alt-n)
endif
if WinExists( $instalacion) then
WinActivate( $instalacion)
sleep(200)
$text=WinGetText( $instalacion)
if StringInStr( $text, "El software que está instalando para este hardware") then ;"The software..."
Send("!c")
endIf
; MsgBox($MB_OK, "Autoit Status", $text & stringinstr( $text, "está"), 2 ) ; sleep(2000)
endif
if WinExists($archivos) then
WinActivate($archivos)
sleep(200)
$text=WinGetText( $archivos)
if StringInStr( $text, "Se necesita el archivo") then
ControlClick( "Archivos necesarios", "", "[ID:2]" )
endIf
endif
if WinExists( $asistente) then
WinActivate( $asistente)
sleep( 200)
$text=WinGetText( $asistente)
if StringInStr( $text, "Desea que Windows se conecte a Windows Update") then ;"Can Windows connect to Windows Update to search for software?"
; ControlCommand( $asistente, "", "[ID:8104]", "Check", "")
sleep(150)
; ControlClick( $asistente, "", "[ID:12324]")
Send("!n")
sleep(100)
Send("!t")
sleep(250)
endif
$text=WinGetText( $asistente)
if StringInStr( $text, "Este asistente le ayudará a instalar software para:") then ;"This wizard"
sleep(150)
Send("!t")
sleep(250)
endif
$text=WinGetText( $asistente)
if StringInStr( $text, "No se puede instalar este hardware") then ;"Cannot Install this Hardware"
ControlCommand( $asistente, "", "[ID:1030]", "UnCheck", "")
sleep(200)
;ControlClick( $asistente, "", "[ID:12325]")
Send("{ENTER}")
sleep(200)
endif
$text=WinGetText( $asistente)
if StringInStr( $text, "desea que haga el asistente?") then ;"What do you want the wizard to do?"
ControlCommand( $asistente, "", "[ID:1049]", "Check", "")
sleep(200)
ControlClick( $asistente, "", "[ID:12324]")
sleep(200)
endif
$text=WinGetText( $asistente)
if StringInStr( $text, "Se recomienda que se conecte a Internet para que el asistente") then
ControlCommand( $asistente, "", "[ID:1065]", "Check", "")
sleep(200)
ControlClick( $asistente, "", "[ID:12324]")
sleep(200)
endif
$text=WinGetText( $asistente)
if StringInStr( $text, "Finalizar para cerrar") then ;"Click Finish to close the wizard."
ControlClick( $asistente, "", "[ID:12325]")
sleep(250)
endif
endif
wend