HOWTO: Fix a Corrupted HAL.DLL file

Sovereign

2[H]4U
Joined
Mar 21, 2005
Messages
3,098
This is from my own personal experience (that I just had), it's something I couldn't find anywhere and figured out myself. I offer this "AS IS" with no warranties or guarentees, express or implied. You use this advice at your own risk and accept sole responsibility for anything resulting from your use of this information.

Whew! Now that the boring stuff is over, on to fixing the problem.

You boot your PC, perhaps because you upgraded something or upgraded to Windows XP. You get an error:
Windows XP Hates You said:
Windows could not start because the following file is missing or corrupt:
<Windows root>\system32\hal.dll.
Please re-install a copy of the above file.
You try the various editing methods to change the BOOT.INI file. You run FIXBOOT from the Recovery Console. Nothing. You try the Recovery Console off your XP CD (as if it's any different than the one you installed. If you don't have the Recovery Console installed, SHAME ON YOU, install it NOW! That's another tutorial though :)) Nada. you try booting into Safemode (but obviously that doesn't work). Exasperated, you find out about this "Windows XP Repair Install" and try that. But when you look at the Windows XP setup screen, the Repair option is not there!

So, you're just about to format right? There is a way around this, that I discovered after accidentally damaging a friend's hard drive with PartitionMagic (that app is the DEVIL do not use it to "merge" partitions, it crashed two friend's computers and I got stuck fixing them).

You need a CD of Windows XP. I do not believe it matters which Service Pack or whatnot. Any will do. Now, follow these steps.
1. Boot from the CD and start the installer
2. Choose to install onto the already formatted partion with the unbootable Windows, but "Leave it as it is," which will require you to create another folder for Windows to avoid writing over the existing installation. I usually tell it "WINXP."
3. Install Windows as you would normally, you'll need a Product Key but you can actually use your personal key with no danger to you losing it, I'll exlain this later.
4. Boot the NEW Windows XP install
5. Edit the BOOT.INI on the hard drive if you messed it up like I did and had four OS entries in it, none of which worked.
6. Go to C:\WINXP\system32\hal.dll and copy it from the new Windows to C:\WINDOWS\system32\hal.dll and overwrite any file there. The new hal.dll is uncorrupt and newly regenerated. The file is specific to each machine and we needed to rebuild it.
7. Try rebooting your computer to see if you can get into your OLD Windows installation. If you can, congratulations!
8. DELETE the "WINXP" folder (or wherever you put your new Windows install).

Now PayPal me some money for all this effort...
j/k! If anyone runs into this situation, they will know how to deal with it.

But it didn't work! I still can't boot! What should I do?
First of all, breathe. Did you choose the right OS to boot from (chances are if you didn't edit BOOT.INI you still have a pointer from your install of Windows that you used to regenerate hal.dll. Go to the System control panel, Advanced, Startup and Recovery, click the "Edit" button so you can mess around with BOOT.INI.

Sample BOOT.INI for XP Pro
Microsoft said:
[boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /NOEXECUTE=OPTIN /FASTDETECT
NOEXECUTE is for Data Execution Protection, and this setting means only core Windows apps will be DEPped.

If you have any questions, just ask them here.
 
Back
Top