As an Amazon Associate we earn from qualifying purchases.
- Before You Start: Read the Error Message
- Step 1: Install Windows Updates and Restart
- Step 2: Open Command Prompt as Administrator
- Step 3: Run DISM to Repair the Windows Image
- Step 4: Run SFC to Repair System Files
- Step 5: Check the Log if the Error Remains
- Step 6: Reinstall the Program That Shows the Error
- Step 7: Re-register a DLL That Exists but Is Not Found
- Step 8: Use System Restore if the Error Started Recently
- How to Check the Fix Worked
- Common Mistakes
- Frequently Asked Questions
A DLL error is one of the most confusing messages Windows can show. A game refuses to start, and the message names a file ending in .dll that the player has never heard of. The file is a shared library, a small bundle of code that many programs use at once, and when it goes missing or gets damaged, every program that needs it stops working. Windows ships with two built-in tools that fix exactly this kind of damage, and neither one needs a download or a third-party cleaner.
This guide is for three groups: players who see a DLL error when launching a game, players who already tried restarting and reinstalling without success, and players who want to understand what the repair tools do so they can tell whether the fix worked. Every command here is taken from Microsoft’s own guidance on repairing system files with DISM and SFC, and the order follows that guidance.
Before You Start: Read the Error Message
Do not skip this step, because the file name in the message tells you where the problem lives. A message that names a file starting with api-ms-win or msvcp points at the Visual C++ libraries that many games share, and reinstalling the affected game or the Visual C++ package often fixes it. A message that names a file starting with d3d or xinput points at DirectX, and the DirectX installer that ships with the game is the right fix. A message that names a system file such as ntdll.dll or kernel32.dll points at Windows itself, and that is where DISM and SFC come in.
Write down the exact file name before doing anything else. A screenshot helps, because the name is easy to mistype and a wrong name sends the search in the wrong direction. Then restart the PC once and try the game again. A restart clears a locked file or a half-finished update, and if the error goes away, the job is done. If it stays, continue with the steps below, in order.
Step 1: Install Windows Updates and Restart
Microsoft’s guidance on the System File Checker tool says to install the latest Windows updates and restart the PC before running the repair tools. Open Settings, go to Windows Update, and select Check for updates. Install anything it offers, then restart when it asks. An update can replace the damaged file on its own, and it also makes sure the repair tools have the newest source files to work from. Try the game again after the restart. If the error is gone, stop here. If it is still there, move on.
Step 2: Open Command Prompt as Administrator
Both repair tools must run in an administrator Command Prompt, because the commands may not work without it. Type cmd in the taskbar search box, right-click Command Prompt in the results, and select Run as administrator. Click Yes on the prompt that appears. The window title should say Administrator, which confirms the window has the rights the tools need. Do not run these commands in a normal Command Prompt window, and do not close the window until every step below is finished.
Step 3: Run DISM to Repair the Windows Image
Run DISM first, because it repairs the Windows image that SFC relies on for its repairs. In the administrator Command Prompt, type the following command and press Enter:
DISM.exe /Online /Cleanup-Image /RestoreHealth
This command goes online to the same source as Windows Update, fetches fresh copies of files, and uses them to repair the Windows image. It needs an active internet connection to work. The scan takes a while, and the progress bar may sit at one number for a long time, which is normal. Wait until the window says the operation completed successfully. If the command reports that it found and fixed corruption, restart the PC before going on.
If the command reports that the source files could not be found, the machine may be offline or the update source may be broken. In that case, check the internet connection first, then run the check commands below to see what DISM found. The two check commands are:
DISM.exe /Online /Cleanup-Image /CheckHealth
DISM.exe /Online /Cleanup-Image /ScanHealth
CheckHealth reports quickly whether corruption was detected. ScanHealth takes longer and reports on the component store in more detail, including whether repairs are possible. Neither one fixes anything on its own. They exist so you can see the state of the image before running RestoreHealth again.
Step 4: Run SFC to Repair System Files
Once DISM has finished, run the System File Checker in the same Command Prompt window. Type the following command and press Enter:
sfc /scannow
Keep a space between sfc and the slash. The tool scans protected system files and replaces any damaged ones with a cached copy from the repaired image. Do not close the window until the verification reaches 100 percent. The scan can take a long time on a slow drive, and closing it early leaves the repair unfinished.
When the scan finishes, the window shows one of three results. “Windows Resource Protection did not find any integrity violations” means the system files are healthy, and the DLL error is probably not caused by Windows itself. “Windows Resource Protection found corrupt files and successfully repaired them” means the fix worked, and you should restart the PC and try the game again. “Windows Resource Protection found corrupt files but was unable to fix some of them” means SFC could not repair everything, and the next step is to run DISM again and then run SFC a second time. If the second run still cannot fix the files, the log holds the details.
Step 5: Check the Log if the Error Remains
If SFC reports files it could not fix, the details are in the CBS.log file in the Windows Logs folder. Open that file in Notepad and search for the word “corrupt” to find the entries that matter. The log lists the exact files that could not be repaired, and that list tells you whether the damage is in a system file, a driver file or a file that belongs to a single program. A file that belongs to a single game or program is not something SFC can fix, because it is not a Windows file at all, and the right move is to reinstall that program instead.
Step 6: Reinstall the Program That Shows the Error
A DLL error that names a file belonging to one game or program is often fixed fastest by reinstalling that program. Uninstall the game or program from Settings, restart the PC, and install it again from its original source. The installer replaces its own files, including the shared libraries it ships with, and it also reinstalls the DirectX and Visual C++ libraries that the game needs. Do not download a single DLL file from a random website and drop it into the Windows folder. A DLL from an unknown source can be the wrong version, built for a different Windows version, or carrying malware, and it can make the problem worse.
Step 7: Re-register a DLL That Exists but Is Not Found
If the DLL file is present on the drive but Windows still says it cannot be found, the file may need to be registered again. The regsvr32 command is the built-in Windows tool for this. In the administrator Command Prompt, run:
regsvr32 filename.dll
Replace filename.dll with the exact name from the error message, and include the full path if the file is not in the system folder. This step only helps when the file exists and is intact. If the file is missing or damaged, re-registering it does nothing, and the right fix is to reinstall the program that owns it or to repair Windows with DISM and SFC again.
Step 8: Use System Restore if the Error Started Recently
If the DLL error began right after a driver update, a program install or a Windows update, System Restore can roll the system files back to a point before the change. Open Settings, search for Recovery, and select Open System Restore. Pick a restore point dated before the error first appeared, and let the machine restart. System Restore changes system files and settings, but it does not delete personal files. If there is no restore point from before the error, this step is not available, and the next step is a Windows reset.
How to Check the Fix Worked
The check is simple and it is the only one that counts. Restart the PC, launch the game or program that showed the error, and use it for a normal session. If it starts and runs without the message, the fix worked. If the same message appears with the same file name, the repair did not reach the cause, and the next step is to search for the exact file name on Microsoft’s support site or the game publisher’s support pages, because the file may belong to a library that needs its own installer. A clean run of DISM and SFC with no integrity violations, followed by the same error, is itself useful information: it means Windows is healthy and the fault lies in the program, its installer or a driver.
Common Mistakes
- Running SFC before DISM, so the repair tool works from a damaged image and cannot fix the files.
- Running the commands in a normal Command Prompt window instead of an administrator one, so they fail or do nothing.
- Closing the Command Prompt window before the scan reaches 100 percent, which leaves the repair unfinished.
- Downloading a single DLL file from a random website, which can be the wrong version or carry malware.
- Reinstalling Windows as a first step, when DISM, SFC and a program reinstall fix most DLL errors with far less disruption.
Frequently Asked Questions
Which command should I run first, DISM or SFC?
Run DISM first. DISM repairs the Windows image that SFC uses as its source of good files, so SFC works correctly only after DISM has finished. Microsoft’s guidance lists the DISM repair before the SFC scan for exactly this reason.
How long does sfc /scannow take?
It depends on the machine and the drive. A fast drive can finish in minutes, while a slow drive can take much longer. The progress bar may sit at one number for a long time, which is normal. Do not close the window until the verification reaches 100 percent.
What does it mean if SFC says it could not fix some files?
It means the damage goes deeper than the cached copies can repair. Run DISM again, then run SFC a second time. If it still cannot fix them, check the CBS.log file for the exact file names, because the damage may be in a driver or a program file rather than in Windows itself.
Can a DLL error be caused by malware?
Yes, it can. Malware can delete or replace shared libraries, and a fake DLL can be planted to run harmful code. If DISM and SFC find damage repeatedly, run a full scan with Windows Security before reinstalling anything, and never download DLL files from unknown websites.