How to Fix: NTDLL.DLL Error - The Definitive Guide

Dennis Faas's picture

Infopackets Reader Gerry O. writes:

" Dear Dennis,

I am running windows 8.1 and have a program that reports an ntdll.dll failure. Will an upgrade to Windows 10 (not clean install) create a new ntdll.dll file, would I need to do a clean install of windows 10? Is there another way of getting a clean ntdll.dll file without upgrading? "

My response:

The file ntdll.dll is typically located in c:\windows\system32, and in very old versions of Windows (such as Windows XP), in the c:\i386 directory. The ntdll.dll file is a legitimate dynamic link library file (DLL) and is referred to as the "NT Layer DLL", which contains vital functions to the Windows kernel. In other words, it's a core component of Windows.

To briefly answer your question: a Windows 10 upgrade will likely resolve your ntdll.dll error because it effectively installs a new copy of Windows. A clean install won't be necessary because of the way that the upgrade is carried out.

With that said, you may receive an ntdll.dll error for various reasons, including:

  • Hard drive errors
  • A virus or malware infection
  • The program which requires access to ntdll.dll has either gone corrupt or is misconfigured
  • A corrupt ntdll.dll file
  • A corrupt user account

Some common ntdll.dll error messages include:

  • STOP: c000021 unknown hard error \systemroot\system32\ntdll.dll
  • (A program) caused a fault in module NTDLL.DLL at (some random memory address)
  • Unhandled exception occurred (some random memory address) at ntdll.dll

In the article below, I will explain in detail how to resolve all of these problems. Please note that the steps are cumulative - please execute them in order.

How to Fix: NTDLL.DLL Errors

Hard Drive Errors

If you have hard drive errors due to dirty file system or possibly with the hard drive itself, then files on the hard drive can become corrupt. Therefore, running check disk (CHKDSK) is the first thing you need to do in order to check the consistency of the hard drive.

To do so:

  1. Click Start and then click My Computer or This PC. Next, locate the C drive and then right click over top of it, then select Properties from the dialogue menu.
  2. Go to the Tools tab and then under the "Error checking" heading, click the "Check" button to perform a scan of the drive. In older versions of Windows (7 and prior), if you check mark "automatically fix file system errors," the computer will need to reboot in order to complete the task. In newer versions of WIndows (8 and 10), you will be prompted to restart the system only if errors are detected on the drive.
  3. To perform a scan of the entire hard drive, I recommend downloading Macrorit Disk Scanner to scan the entire hard drive for errors. This will undoubtedly take a very long time to complete -- so be prepared to wait a few hours depending on the size of your hard drive. If you see any red squares during the scan, it means your hard drive is beginning to fail; as such, there is a very good chance that this may be related to the ntdll.dll error message you are receiving. In that case, you should backup the hard drive immediately and plan to replace it with another drive.

Please note: if your hard drive is failing and you need help backing up and transferring the drive contents to another, I can assist via remote desktop support. Simply contact me with a brief message and I'll get back to you as soon as possible.

A Virus or Malware Infection

Once you've scanned the hard drive for errors, the next thing to do is to scan your system for viruses and malware. To do so:

  1. If you already have antivirus installed, then make sure it is up to date and run a full system scan. If you don't have antivirus installed, then I suggest you download and install Avast! antivirus (free) and only enable the real-time file scanning -- all other protection is more or less redundant and will inevitably slow down your PC. Once it is installed, do a full system scan.
  2. Once you have scanned for viruses, you can also perform a malware scan. For this task I recommend Malwarebytes Antimalware (free). When you install the program, I suggest you do not run the free trial of the Premium version, otherwise it will quit working after 30 days and prompt you to purchase the program. This is really not necessary, as you can run manual scans on the free version any time you want, and only when you think you might be infected.

A Program which Requires Access to NTDLL.DLL is Corrupt or Misconfigured

You may receive an ntdll.dll error if a program associated with the DLL is corrupt or misconfigured. The best way to illustrate this is through some examples below.

In the case of Internet Explorer (IE): oftentimes users report crashes with ntdll.dll; this type of ntdll.dll crash is usually related to an IE addon causing a misconfiguration or conflict with Internet Explorer. One way to get around this problem is to review your addons for Internet Explorer and systematically disable each one until you no longer receive the error. Once you find the offending addon, keep it disabled and/or uninstall it, then re-enable the rest.

In the case of an installed program: another possibility is that an installed program has gone corrupt and is conflicting with ntdll.dll. If the crash only happens when you run a particular program, then it's a safe bet that reinstalling that program will fix the issue.

A Corrupt NTDLL.DLL File

The next step is to check the integrity of Windows itself to ensure that the ntdll.dll file has not been compromised.

To do so:

  1. Click Start, then type in "cmd" (no quotes). Wait for CMD.EXE or Command Prompt to appear in the list, then right click it and select Run as Administrator.
  2. Next, use your mouse to highlight the text below:

    sfc /scannow
    dism /online /cleanup-image /restorehealth
    echo this is a dummy line
  3. Right click over the highlighted text above, then select Copy from the dialogue menu. Then go back to the administrative command prompt and right click in the middle of the window and select Paste from the dialogue menu. The text you copied in Step #2 should now be output on the command line and the system file checker (sfc) utility should now be scanning your hard drive; this will take a while. Pay close attention to any errors. If you receive any error messages then you likely have a corrupt installation of Windows. In this case you try my guide 'sfc /scannow fails, won't complete' and hope that it fixes the issue.
  4. When the 'sfc /scannow' completes, the DISM (Deployment Image Servicing and Management) program will run - but only for Windows 8 and 10 users. This is a second layer of system file scanning that will actually repair damaged system files (in some cases) by downloading the appropriate file from Microsoft's servers. DISM doesn't always work, however, and may report an error message. Note that if you receive an error that "DISM" is not found, then it is because you are not running Windows 8 or 10 and you can safely ignore this error message.

If you have errors after running 'sfc /scannow' or if DISM reports it "failed to repair", then you are more than welcome to contact me for help in resolving this issue using my remote desktop support service, as I am very good at troubleshooting these errors. You can also try the next step in the article, but in all likelihood, it will not work because you have damaged system files.

A Corrupt User Account

If you've managed to get this far in this article, the next thing to try is using another user account on Windows to see if this fixes the problem. The easiest way to do this is to enable the hidden Administrator account in Windows. Once the account has been enabled, you'll then need to login as the Administrator (without a password), then try and run whichever program or function that is causing the error in order to see if the problem still exists.

To do so:

  1. Click Start, then type in "cmd" (no quotes). Wait for CMD.EXE or Command Prompt to appear in the list, then right click it and select Run as Administrator.
  2. Next, use your mouse to highlight the text below:

    net user administrator /active:yes
    echo this is a dummy line
  3. Right click over the highlighted text above, then select Copy from the dialogue menu. Then go back to the administrative command prompt and right click in the middle of the window and select Paste from the dialogue menu. The text you copied in Step #2 should now be output on the command line and the Administrator account should now be enabled.
  4. Please note that when you log in as the Administrator user, the bookmarks in your current user account will not be shared. Therefore, you will probably want to bookmark this page in your browser now, so you can come back to it later; you may also want to print this page so that you can proceed to the next step.
  5. Now it's time to login as the Administrator. To do so, click Start and then select Shutdown -> Log Off. When you get back to the Windows Login screen, select the Administrator account; you won't need to enter in a password. Note that it may take a while for the Administrator account to generate before you can get to the desktop.
  6. When you reach the desktop, try running the program you had problems with previously; it may take a few days of testing to be sure that the problem has been resolved, so please take your time and test repeatedly. If you've done rigorous testing and there haven't been any issues, then you can be reasonably sure that your original user account is corrupt and you will need to create a new user account to fix the issue. This will likely mean reinstalling and reconfiguring some programs. If you need help with this process, you can contact me and I can do it for you (for a nominal fee) using my remote desktop support service.

Additional 1-on-1 Support: From Dennis

If all of this is over your head, or if you need additional support in fixing the ntdll.dll error, then you are welcome to contact me for additional 1-on-1 support using my remote desktop support service. Simply use the contact form to send me a brief message detailing your problem, and I will get back to you as soon as I can.

Got a Computer Question or Problem? Ask Dennis!

I need more computer questions. If you have a computer question - or even a computer problem that needs fixing - please email me with your question so that I can write more articles like this one. I can't promise I'll respond to all the messages I receive (depending on the volume), but I'll do my best.

About the author: Dennis Faas is the owner and operator of With over 30 years of computing experience, Dennis' areas of expertise are a broad range and include PC hardware, Microsoft Windows, Linux, network administration, and virtualization. Dennis holds a Bachelors degree in Computer Science (1999) and has authored 6 books on the topics of MS Windows and PC Security. If you like the advice you received on this page, please up-vote / Like this page and share it with friends. For technical support inquiries, Dennis can be reached via Live chat online this site using the Zopim Chat service (currently located at the bottom left of the screen); optionally, you can contact Dennis through the website contact form.

Rate this article: 
Average: 5 (14 votes)