Bad Image Error 0xc000012f in Windows 11 and 10: What It Means and How to Fix It

Intact glowing blue cube beside a cube cracked in two, with a red warning triangle above it, in front of a blank app window
Intact glowing blue cube beside a cube cracked in two, with a red warning triangle above it, in front of a blank app window

A Bad Image error 0xc000012f appears when Windows tries to load a file it finds on disk but cannot read as a valid program or library. The pop-up usually names a file ending in .dll and asks you to reinstall the program or contact its vendor. This guide explains what the code means, how to read the file name, and which fixes to try in a safe order.

Last reviewed: November 24, 2026. Steps were compared with Microsoft documentation where a page exists; none was run on a real PC. The top picture is a generated illustration.

Quick answer: what a Bad Image error 0xc000012f means

In short, the Bad Image error means Windows loaded a file that is damaged, built for a different type of system, or not a valid image at all. The file name and path in the dialog show which program or Windows component owns it. Most cases are fixed by repairing or reinstalling that program, then checking Windows system files. Work through the steps in order and stop as soon as the error is gone.

The short version

  • Write down the full file path and the status code from the dialog before you change anything.
  • Restart the PC, then repair or reinstall the app that owns the file.
  • If the file is a runtime library, repair the Microsoft Visual C++ Redistributable that matches it.
  • Check Windows Update, run DISM and then SFC, and check drive health before any drastic step.
  • Never copy a DLL from a download site, and never run chkdsk /f or chkdsk /r on a drive that may be failing.

In this guide

What this error means

Windows loads program files and libraries only when they have the expected format. The code 0xc000012f is an NTSTATUS value. Microsoft's NTSTATUS list names it STATUS_INVALID_IMAGE_NOT_MZ and describes it as an image file that does not have the correct format because it has no initial MZ. In plain terms, the file Windows tried to load does not look like a valid program or library.

The same list places the quoted dialog wording against a different code, 0xc000007b, under the name STATUS_INVALID_IMAGE_FORMAT. So the words on your screen may not match the code exactly. Treat the file name and the code together as your clue. If the code you see is 0xc000007b, read the separate guide on the 0xc000007b error instead, because it has its own causes and steps.

Some reports also mention 0xc0000020. Microsoft's list names that code STATUS_INVALID_FILE_FOR_SECTION and describes a mapping file whose attributes cannot be read. Both codes point the same way: Windows found a file but could not use it.

A Bad Image error is not the same as a missing file error. When Windows says a file cannot be found at all, the problem is a missing file, and the guide to the msvcp140 and vcruntime140 missing file errors covers that case. A NOT FOUND message that names an api-ms-win-crt file belongs to our guide to the api-ms-win-crt-runtime DLL error. A Bad Image error means the file is present but invalid, so copying in a fresh file is not the first move. For broader DLL problems, see the general guide to DLL errors.

Windows follows a simple sequence when this error appears. The steps below describe it in plain terms.

  1. The app asks for a file. A program starts and asks Windows to load a library or component from disk.
  2. Windows checks the file. It reads the file header and expects a valid program image for this system.
  3. The check fails. The file is damaged, has the wrong type or architecture, or was never a valid image, so Windows stops the load.
  4. The dialog names the file. The path tells you whether the owner is an app or Windows itself.

As a rule of thumb, a path under a Program Files or AppData folder usually points to an installed app or its helper components. A file in System32 usually points to a Windows component. This is a guide to reading the path, not a rule that never has exceptions, so check the folder name and the program you were using when the dialog appeared.

The common triggers are an update or installation that was interrupted before it finished, a bad install, a damaged download, drive errors that corrupt data as it is read, and security software that quarantined or altered a file. Any of these can leave a file that Windows finds but cannot load. That is why the fixes start with the owning app and move toward system-wide checks.

Symptoms, causes and first checks

The table below matches common symptoms with a likely cause and a place to start. It is a starting point, not a diagnosis, because the same code can come from more than one source.

SymptomLikely causeWhere to start
Dialog names a file under Program FilesDamaged app file or a broken installRepair or reinstall that app
Dialog names a file under System32A Windows component damaged, often after an interrupted updateWindows Update check, then DISM and SFC
Error started right after an updateThe update left a file or component in a bad stateUninstall the latest update, then try System Restore
Error keeps returning from the same driveDrive errors or failing storageCheck drive health before more repairs

Which path to take

Use this short decision tree after you have the file path from the dialog. Each branch leads to a step in the next section.

  • Does the dialog name a file under Program Files or AppData?
    • Yes: repair or reinstall that app (step 3). If the file is a runtime library, repair the matching redistributable (step 4).
      • If the file belongs to an older runtime such as msvcr120, the guide to the msvcr120 file covers a related but different problem, so check the file name first.
    • No, it names System32 or another Windows folder: check Windows Update (step 5), then run DISM and SFC (step 6).
  • Did the error start right after an update? Uninstall that update (step 8) after the basic checks.
  • Does the same drive keep producing the error? Check drive health (step 7) before running anything else on it.

Step-by-step fixes

Work through these steps in order. Each one gives an action, what you should see when it works, and what to do if it fails. Stop at the first step that clears the error, but keep the note from step 1 until the error is gone.

Before you start

Back up your important files before any repair, especially before the steps that change system files. The guide to backing up a Windows PC with a system image explains one way to do this.

Never replace a DLL by copying one from the internet. A file of the wrong version or a tampered file can make the problem worse and is hard to undo. Do not run chkdsk /f or chkdsk /r on a drive that may be failing, because those repairs write to the disk. Check the drive first. Do not disable Windows Security to get a program running.

Step 1: Note the file path and the status code

Read the dialog carefully and write down the full path, the file name and the status code. If the dialog does not show a full path, write down the program you were running when it appeared and the action you took just before.

You should see: a written note with a file name, usually ending in .dll or .exe, and a path that points to a program folder or to System32.

If this fails: if no file name appears, the error may come from a different program than you expect. Repeat the same action slowly, and note which window was open. You can also use the Reliability Monitor guide to find crash records near the time of the error.

Step 2: Restart the PC

Save your work, close the program, and restart Windows from the Start menu through Power and then Restart. Menu names can differ between Windows builds. After the restart, run the same action once.

You should see: the program starts without the dialog. If the dialog returns, carry on to step 3 with your note from step 1.

If this fails: if Windows will not start normally, use the guide to starting Windows in Safe Mode. Safe Mode starts with a smaller set of drivers and services, which makes the next steps easier to run.

Step 3: Repair or reinstall the app that owns the file

Open Settings, then Apps, then Installed apps. Menu names can differ between Windows builds. Find the program that owns the file path from your note. If it offers a Repair or Modify option, choose it and follow the prompts. If no repair option exists, uninstall the program and reinstall it from the original installer or the vendor's official site.

You should see: the repair finishes without errors, and the program starts. Run the action that triggered the dialog once to confirm.

If this fails: if the same file path returns after a clean reinstall, the installer may be damaged or security software may be blocking the file. Use the guide to removing programs completely before reinstalling, and if the program still will not start, read the guide to apps that cannot run on your PC. Then continue to step 4.

Step 4: Repair the Visual C++ Redistributable if the file is a runtime

If the file name looks like a runtime library, such as one starting with vcruntime or msvcp, the owner is often a Microsoft Visual C++ Redistributable package. Open Settings, then Apps, then Installed apps, and find the Microsoft Visual C++ entries. Choose Modify, then Repair where it is offered. If the program asks for a version that is not installed, install that version from the official Microsoft download page rather than from a third-party site.

You should see: the repair completes and the program starts without the dialog. Where a runtime is reported as corrupt, the repair replaces the package's own files and does not require you to copy any single DLL by hand.

If this fails: the program may need a different version, or the package may have been installed for a different processor type. Install the version the program names, and reinstall the program afterwards so it registers against the repaired runtime. For a file that Windows cannot find at all, read the guide to the vcruntime140_1 missing file, which covers that different situation.

Step 5: Check Windows Update and optional updates

Open Settings, then Windows Update, then select Check for updates. Install any pending updates and restart when asked. Then look under Advanced options for Optional updates, which can contain driver updates. Menu names can differ between Windows builds. For driver updates, the guide to updating drivers on Windows 11 explains the safe route.

You should see: a message that your device is up to date, or a list of updates that installs without errors. After the restart, run the action once more.

If this fails: if updates keep failing, the guide to Windows Update that is stuck or failing covers the next checks. Do not stop there if the error is still present. A damaged update can be the cause, so move on to step 6 and let DISM handle the damaged files.

Step 6: Run DISM, then SFC

Search for Command Prompt, right-click it, and select Run as administrator. Accept any prompt that appears. In the window, type the first command below and press Enter. It can take several minutes.

DISM.exe /Online /Cleanup-image /Restorehealth

When DISM finishes, type the second command and press Enter. Do not close the window until the verification reaches 100 percent.

sfc /scannow

Microsoft's guidance is to run DISM before SFC, because DISM provides the files that SFC needs for some repairs. By default DISM uses Windows Update as its source, so a broken update client can get in the way. The guide to repairing Windows system files with SFC and DISM covers the source options.

You should see: a message such as Windows Resource Protection did not find any integrity violations, or one saying it found corrupt files and repaired them. Restart the PC if it asks, then run the action again.

If this fails: if SFC reports that it could not perform the operation, Microsoft suggests running SFC from Safe Mode and making sure the PendingDeletes and PendingRenames folders exist under C:\Windows\WinSxS\Temp. If SFC says it found corrupt files but could not fix some of them, Microsoft describes copying the SFC entries from the CBS log into a text file on the desktop. Type this command in the elevated window:

findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt"

Read the file for the name of the file that could not be repaired. Do not replace that file from the internet. Continue to the drive check and the later steps instead.

Step 7: Check drive health before more repairs

If the error names a file on a drive that has been slow, noisy or throwing errors, check its health first. Open Settings, then System, then Storage, and look for the drive's health or disk status. Menu names can differ between Windows builds. You can also use the diagnostic tool that the drive maker provides. The guide to checking hard drive and SSD health with SMART explains what the readings mean.

You should see: a healthy status with no warnings about bad sectors, failing blocks or drive failure.

If this fails: if the drive reports a warning or a failure, back up your files now, following the Before you start box, and plan to replace the drive. Do not run chkdsk /f or chkdsk /r on a failing drive, because those repairs write to the disk. Continue with the next steps only after your files are safe.

Step 8: Uninstall the latest update if the error started after one

If the dialog began right after a Windows update, remove that update and see whether the error stops. Open Settings, then Windows Update, then under More options select Update history. Under Related settings select Uninstall updates. Select the update from the list and select Uninstall. Microsoft's guidance says some updates cannot be uninstalled, and that you should understand the risks before removing a security update. The guide to rolling back a Windows update covers the choices in more detail.

You should see: the update is removed after a restart, and the error no longer appears for the same action.

If this fails: if no Uninstall option appears, the update cannot be removed this way. Microsoft's page also describes uninstalling an update from Windows Recovery Environment through Troubleshoot and then Advanced options, if you cannot reach Windows at all. Menu names can differ. Move to step 9.

Step 9: Use System Restore

If you have a restore point from before the error began, System Restore can return system settings and files to that earlier state. Search for Create a restore point, open it, select System Restore, and choose a restore point made before the problem. Read the list of affected programs the wizard shows before you confirm. The guide to using System Restore explains each screen.

You should see: the restore finishes, the PC restarts, and the dialog no longer appears for the same action.

If this fails: if no restore point exists, or the option is missing on this PC, skip this step and run the scan in step 10.

Step 10: Run a Windows Security scan

Open Windows Security, select Virus and threat protection, and run a Quick scan, then a Full scan if the quick scan finds anything. Menu names can differ between Windows builds. Follow the prompts to remove or quarantine any threat. If security software quarantined a file that a program needs, reinstall that program from step 3 rather than restoring the file by hand. The guide to removing malware from a Windows PC covers the next checks if the scan finds something.

You should see: a scan that completes with no threats, or with threats removed. Restart the PC and run the action again.

If this fails: if the scan keeps finding the same file or the program keeps losing files, keep Windows Security turned on and move to the final step. Do not disable it to get the program running.

Step 11: Repair install as a last resort

If the earlier steps did not clear the error, a repair install of Windows can replace damaged system files while keeping your personal files and most apps. It needs official Windows installation media. The guide to repairing Windows 11 without losing files explains the steps. We did not compare this final step against a Microsoft page in this check, so follow that guide with care and keep your backup ready.

You should see: Windows starts at the desktop with your files in place, and the dialog no longer appears for the same action.

If this fails: if the error returns after a repair install, stop and read the section below on when to get help.

How to tell it is fixed

The error is gone when the action that used to trigger the dialog completes normally after a restart. Repeat that action once after each restart you make during the steps, and once more at the end. If you also ran SFC, a clean result is the message that no integrity violations were found, or a repair message followed by a clean run on the next check.

Also confirm that the file path from your note no longer appears in any dialog. A quiet log or a clean run does not prove the file is healthy on its own, so the real test is the program working as it should.

When to stop and get help

Stop and get help when the error names a System32 file and persists after DISM, SFC and a repair install, when the drive shows a failure warning, or when the file belongs to business software that you cannot repair or reinstall yourself. In those cases, contact the software vendor or a qualified technician, and bring your note with the file path and status code.

A reset is another option when the repair install fails, but it changes more settings. The guide to resetting Windows 11 and keeping your files explains the choices, so read it before you start. If you are not sure which step applies to your case, the repair assistant page can help you narrow the problem down before you act.

Frequently asked questions

About the error

Is the Bad Image error 0xc000012f a virus?

Not by itself. The code describes a file that is not a valid image, which can come from a bad install, a damaged download or a drive problem. Malware can damage files too, so run the scan in step 10 and do not assume an infection without evidence.

Why does the dialog name a DLL when I installed a program?

A program often ships its own library files and loads them at startup. If one of those files is damaged or was replaced with the wrong type, Windows names it in the dialog even though you never touched it.

How is a Bad Image error different from a missing file error?

A missing file error means Windows cannot find the file at all. A Bad Image error means the file is present but invalid. If the file is absent, read the guide to the d3dx9_43 missing file for an example of that case, since the fixes differ.

Can this error appear on Windows 10 as well?

Yes, as far as we can tell. The NTSTATUS list is a Windows-wide reference rather than one for a single version, so the code can appear on Windows 10 too. We did not check reports that are specific to Windows 10, so treat the steps as general guidance.

About the fixes

Can I download the damaged file from a website?

No. A file copied from a download site can be the wrong version, out of date or altered. Repair or reinstall the program or runtime that owns the file instead, as the steps describe.

Will DISM and SFC delete my personal files?

Microsoft describes DISM and SFC as tools that repair system files. They are not cleanup tools, and they are not meant to remove your documents. Back up your files before any repair anyway, as the Before you start box advises.

Should I run chkdsk /f to fix this error?

Not when a drive may be failing. Check the drive's health first, and back up your files if it reports a problem. Running chkdsk /f or chkdsk /r on a failing drive can write to it and make things worse.

Should I turn off Windows Security while I fix this?

We do not recommend it. Run a scan in step 10 instead, and if the scan quarantines a file the program needs, reinstall that program so it brings back a clean copy.

More help

For more fixes that cover related Windows errors, browse our PC repair guides and choose the topic that matches the symptom you see on your screen.

How this guide was checked

We compared the steps with four Microsoft pages: the NTSTATUS values list, the System File Checker article, Repair a Windows Image, and How to uninstall a Windows Update. We could not open Microsoft's Windows 10 support end page in this check, so we do not cite it. Steps were compared with that documentation where a page exists, and none was run on a real PC. Menu names can differ between Windows builds, so check the wording on your own screen.

Sources