1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

<windows root>\system32\hal.dll, missing or corrupt file

Discussion in 'Windows XP' started by LarryFlix, Dec 6, 2009.

Thread Status:
Not open for further replies.
  1. LarryFlix

    LarryFlix Thread Starter

    Dec 6, 2009
    Windows could mot start because the following file is missing or corrupt:
    <windows root>\system32\hal.dll. Please re-install a copy of the above file.
  2. Sponsor

  3. lisa6447


    Dec 6, 2007
    Welcome to TSG i had this problem i did a system restore worked fine
  4. lisa6447


    Dec 6, 2007
    After you try this and maybe it does not work for you... Change the boot order in your bios to boot from cd/drive then put in your installion disc and restart computer after it loads files choose repair option
  5. johnebadbak


    Feb 28, 2002
  6. TheOutcaste


    Aug 7, 2007
    How to fix the missing or corrupt <windows root>\system32\hal.dll error.

    This could be due to an invalid boot.ini file, which is more common than the hal.dll file actually being missing or corrupted. Could be other things contributing as well.

    First, boot to the XP Recovery Console.
    Set your system to boot from CD, either by setting the boot order in the BIOS, or using the boot menu if your system provides one, usually by pressing one of the FX keys; F9, F10, F12 are common.
    Insert the Windows XP CD and boot the system.
    When prompted to Press any key to boot from CD... press any key like Spacebar or Enter

    When you boot from the CD, the following is displayed:
    On a black screen:
    Setup is inspecting your computer's hardware configuration...
    Screen turns Blue, and Windows Setup is displayed at the top.
    at the bottom is displayed the following in sequence:
    Press F6 if you need to install a third party SCSI or RAID driver
    Press F2 to run Automated System Recovery (ASR)...
    Setup is loading files (file names displayed)
    Title changes to Windows XP Professional (or Home Edition) Setup

    The options to setup or repair Windows are displayed
    Choose To repair a Windows XP installation using recovery console, press R.
    You may need to choose the Windows installation if you have a dual boot system. Type the number of the Windows installation you want to log into.
    You will need to enter the Administrator password unless you previously disabled that requirement; if it's blank, just press enter.

    You should now be at a C:\WINDOWS> prompt
    Type the following lines pressing enter after each one. Change the drive letter if needed.
    Note that there are spaces between each differently colored part of the commands:

    1. CD \ (There is a space after CD)
    2. Ren Boot.ini Boot.old
      If you get an error that the file can't be found skip step 3.
    3. Type Exit. This will reboot the system. Re-enter the Recovery Console and start at step 4.
      (If you don't reboot, any previous entries in the boot.ini file might get added again, as they are stored in memory)
    4. Type BootCfg /Rebuild
    This will go through several prompts.
    The following is an example. You would type the colored text:
    Scanning all disks for Windows installations.
    Please wait, since this may take a while...
    The Windows installation scan was successful.
    Note: These results are stored statically for this session.
          If the disk configuration changes during this session,
          in order to get an updated scan, you must first reboot
          the machine and then rescan the disks.
    Total identified Windows installs: 1
    [1]: C:\WINDOWS
    Add installation to boot list? (Yes/No/All):[B][COLOR=Red]y[/COLOR][/B]
    Enter Load Identifier:[B][COLOR=Red]Microsoft Windows XP Professional[/COLOR][/B] (or what ever you want to identify the OS)
    Enter OS Load Options:[B][COLOR=Red]/noexecute=optin [COLOR=Blue]/fastdetect[/COLOR][/COLOR][/B]
    Note: There is a space between [B]optin[/B] and [B]/fastdetect[/B]
    Type Fixboot
    type Y to write the new boot sector

    Remove the CD, then type Exit and see if it will boot into Windows.

    If that doesn't work, we can try replacing the hal.dll file, either from the ServicePackFiles folder (if present) or the CD.
    There are 7 different versions of the hal.dll file. When Windows XP is installed, it selects the correct file from one of the following and renames it to hal.dll
    HAL File Copied    Computer Description in Device Manager
    Halmacpi.dll       ACPI Multiprocessor PC
    Halaacpi.dll       ACPI Uniprocessor PC
    Halacpi.dll        Advanced Configuration and Power Interface (ACPI) PC
    Halmps.dll         MPS Multiprocessor PC
    Halapic.dll        MPS Uniprocessor PC
    Hal.dll            Standard PC
    Halsp.dll          Compaq SystemPro Multiprocessor or 100% Compatible
    The first three are the most common. If you have two processors, or a dual/quad core processor, the ACPI MultiProcessor PC hal (halmacpi.dll) is the one to use.
    If a Single core/Single processor, one of the next two should be chosen, Halaacpi.dll or Halacpi.dll.
    If you are not sure, you can pick the Standard PC Hal.dll, and then we can check the version of the old file after booting to Safe Mode, then correct our choice if needed.
    Running System Restore after replacing the hal.dll file might not replace this file with the correct version, so easiest to replace it manually.

    There are two other files that are tied to the hal.dll. They are:

    For single processor systems, the files are named the same as above.
    For multi-processor systems, these two files get renamed:
    ntkrnlmp.exe -> ntoskrnl.exe
    -> ntkrnlpa.exe
    I haven't tested all combinations of these files to see which will work. If you install the Standard PC hal.dll, you may need to also install the single processor versions of ntoskrnl.exe and ntkrnlpa.exe or the system might not boot.
    On a Dual Core Pentium D system running XP MCE 2005 w/SP2 (Same as XP Pro), the system will not boot after replacng the hal.dll file with the one from the CD. I had to replace the ntoskrnl.exe and ntkrnlpa.exe files with the single processor versions for it to boot, and the system then was only using one core from the Pentium D processor.
    The correct file to use on this system is the halmacpi.dll
    The ntkrpamp.exe and ntkrnlpa.exe files will be in the i386\SPX.CAB file on the CD, where X is the Service Pack number.
    To extract the file, use this command in the Recovery Console, using the appropriate SP# and file name:
    expand D:\i386\SP2.cab /F:ntkrnlpa.exe C:\Windows\System32
    Once expanded, rename if needed.

    Boot to the Recovery Console as above.
    Type the following:
    CD System32
    Ren hal.dll halold.dll

    If the hal.dll file is actually missing, this will give an error, just ignore it.
    Copy ntoskrnl.exe ntoskrnl.old
    Copy ntkrnlpa.exe ntkrnlpa.old
    Dir C:\Windows\ServicePackFiles\i386\hal*

    Do one of the following depending on the result
    Note: Do not add a space between the Dark Red and Red sections

    1. If it lists 7 files (or at least hal.dll)
      type the following:
      Copy C:\Windows\ServicePackFiles\i386\hal.dll C:\Windows\System32\hal.dll
      Replace hal.dll with the appropriate file name from the above table.
      Do NOT change hal.dll
      Example for an ACPI Multiprocessor PC:
      Copy C:\Windows\ServicePackFiles\i386\Halmacpi.dll C:\Windows\System32\hal.dll
      [*]If you get an error The system cannot find the file or directory specified.
      Type the following:
      Find the line Device\CdRom0 and note the drive letter X:. This is your CD-Rom.
      Expand X:\i386\hal.dl_ C:\Windows\System32\hal.dll
      Replace hal.dl_ with the appropriate file name from the above table, but change the last L to an underscore. Do NOT change hal.dll
      Some OEM CDs have those files uncompressed. If you get an error that the file can't be found type this:
      dir X:\i386\hal*.*
      If the files are listed with a .dll extension instead of .dl_, use Copy instead of Expand, and use .dll

    Remove the CD, then type Exit
    When the system reboots we want to boot to Safe Mode, so tap F8 to bring up the Advanced Startup Menu and choose Safe Mode.
    If other files have been corrupted, you may get a different error message. Post the complete error message, and we'll see what other steps need to be taken.
    Otherwise, you should end up in Safe Mode.
    If the system hangs, and you copied the Standard hal.dll file, you may need to go back into the Recovery Console and copy the single processor versions of ntoskrnl.exe and ntkrnlpa.exe from the CD or the C:\Windows\ServicePackFiles\i386 folder into the C:\Windows\System32 folder

    Check which version the old file was:

    1. Double click My Computer
    2. Double click the C: drive
    3. Double click Windows
    4. Double click System32
    5. Right click on halold.dll, click Properties.
      If hal.dll was missing, the halold.dll file won't exist. Best we can do here is see if ntoskrnl.exe and ntkrnlpa.exe are Uniprocessor versions or Multiprocessor versions, and use a matching hal.dll
    6. Click the Version tab
    7. Click on Original File Name
    8. The original name will be displayed.
    9. Repeat for the ntoskrnl.old and ntkrnlpa.old files
    If the wrong hal file was chosen, you may at some point get a notice that Windows has finished installing new devices and needs to reboot. Click No.
    If you need to change the file, first copy it to your desktop.
    Copy the correct file(s) from the CD, or from the C:\Windows\ServicePackFiles\i386 folder.

    1. If it is compressed (it'll have a .dl_ or .ex_ extension) we first need to expand it.
      Click Start | Run, type cmd, Press Enter
      type the following:
      CD /D %userprofile%\Desktop
      expand halXXXX.dl_ hal.dll

      where halXXXX.dl_ is the name of the file you copied
    2. If not compressed, just rename the file to hal.dll
    3. Do the same for the ntoskrnl.exe and ntkrnlpa.exe files
      Use ntkrnlmp.exe and ntkrpamp.exe if you want the Multi-processor versions
      renaming them to ntoskrnl.exe and ntkrnlpa.exe
      The ntkrpamp.exe and ntkrnlpa.exe files will be in the i386\SPX.CAB file on the CD, where X is the Service Pack number.
    Now navigate back to the C:\Windows\System32 folder and drag the hal.dll, ntoskrnl.exe, and ntkrnlpa.exe files from the desktop and drop it into the System32 folder. You'll be asked if you want to replace the existing files, click Yes

    Reboot the system.

    If at any point it told you that it installed new devices it will have installed "ghost" drivers. These can cause issues so here's how to remove them.
    These ghost drivers will show if you boot to Safe Mode and check the Device Manager. (Click View | Show hidden devices).

    Or we can set the Device Manager to show them in Normal mode:
    Go to Control Panel | System
    Click the Advanced tab, then click the Environment Variables button
    Under the System variables section, click the New button.
    In the Variable name: box type DevMgr_Show_NonPresent_Devices
    In the Variable value: box type 1
    Click OK, then click OK again on the Environment Variables window
    In Device Manager, Click View | Show hidden devices

    Any duplicate drivers, and drivers for devices not connected (USB Flash etc), will show up as "ghost" icons.
    Go through each category in Device Manager and remove each "ghost" by right clicking, then click Uninstall.
    Note that there are several items under Non-Plug and Play Drivers and Sound, video and game controllers that are normal to show as a "ghost" icon, such as Microsoft Kernel devices. Don't remove them unless they are duplicated, then remove both instances.
    Under Network Adapters there will also be a RAS Async Adapter and possibly a Microsoft TV/Video Connection item, you can leave those as well unless they are duplicated.
    External USB drives, Flash drives, and memory cards that are not connected will show as ghost devices under Disk Drives. Removing these entries won't hurt anything, but if you've assigned a specific drive letter to these devices, you'll have to re-assign the drive letter again. You may want to make sure those devices you use frequently are connected.
    For the Computer Category, if there are two entries, remove the one that doesn't match the hal.dll file you installed.

    A Vista/Win7 DVD can also be used to for this, except you have to manually edit the boot.ini file. A Vista RE disk can be downloaded from one of these links:
    Vista Recovery Environment CD
    64 bit Vista
    32 bit Vista

    Boot with the DVD
    Select your language and click Next
    Click Repair your Computer
    After it scans for Windows installations click Next (Win7: Select Top option first)
    Click Command Prompt.
    Type the following, press Enter after each line:
    attrib -H -R -S C:\boot.ini
    Notepad c:\boot.ini

    Correct any errors, then save the file
    Close Notepad
    In the Command Prompt, type the following and press Enter:
    attrib +H +R +S C:\boot.ini
    (If you get errors that the file can't be found, either the boot.ini file is missing, or the drive letter is not C:
    Sometimes the drive letters are different when booted to a CD/DVD.
    In Notepad, click File | Open
    Click Computer on the left. This will show the drives on the PC as seen by the Recovery Environment
    If the boot.ini file is missing, use Notepad to create one).

    For the rest of the procedure, you can use the Command Prompt and follow the instructions above.
    (Use Notepad to determine the CD-ROM drive letter if needed, rather than Map)
    You can use Notepad as a mini Windows Explorer, and browse to the files, but would need to use the Command Prompt to expand the files from the XP CD.
    In the Command Prompt:
    Type Notepad
    Notepad should open
    Press Alt+Tab to switch back to the Command Prompt
    Press the Up Arrow, then Enter. This will open a 2nd instance of Notepad.
    Click File | Open
    Change the Files of type: box to All Files
    Press Alt+Tab to switch to the other Notepad window
    Click File | Open
    Change the Files of type: box to All Files
    Position the two Open dialogs so you can easily switch between the two, and widen them if needed.
    Depending on your Screen Resolution, they may overlap.
    I position one top left, and one bottom right.


  7. pccare_himanshu


    Nov 3, 2009
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/883195