[Fix] Error Status 0xc000012f “Bad Image” When Running a Program

When you run a program in Windows, error 0xc000012f may pop up mentioning that the binary you’re trying to run is corrupted. Here are some examples, with the full error message verbatim:

<filename> is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support. Error status 0xc000012f
C:\Windows\System32\schannel.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor. error: 0xc000012f

bad image error c000012f

Error 0xc000012f means “Bad image” denoting that the program’s executable or one of the supporting modules are corrupt. Or there is probably a DLL mismatch and especially seen in programs that use Microsoft Visual C++ 2015 Redistributables.

In developer’s terms, 0xC000012F means STATUS_INVALID_IMAGE_NOT_MZ, which means the specified image file did not have the correct format. It did not have an initial MZ. It’s possible that the runtime libraries versions or bit are mismatched. For example, the 64-bit version of a DLL may have been accidentally copied to C:\Windows\SysWOW64 directory which is meant to store 32-bit modules.

The error may occur in any version of Windows, and the fixes below apply to all versions, including Windows 10.

Fix 1: Uninstall & Reinstall the program

Uninstalling and then reinstalling the affected program helps in most cases. Be sure to have the setup file ready.

>Right-click Start, click Run. Type appwiz.cpl and click OK. Right-click on the program which is causing the error 0xc000012f “Bad image”, and click Uninstall.

uninstall a program via control panel

(In Windows 10, you can also use Apps & Features via the modern Settings UI to uninstall programs. Click Start, Settings, Apps & Features.)

Note that some vendors offer “clean” uninstaller tools to remove all traces of their program completely. In most cases, the uninstaller tools are more effective than the standard uninstall routine. If the vendor has such a tool, download and run it in addition.

Run the program’s Setup again to reinstall it. If you don’t have one, visit the software vendor’s website and download the program.

Fix 2: Uninstall the Problematic Windows Update

If “Fix 1” doesn’t help, and the “bad image” error occurred only after installing a particular Windows Update, try uninstalling the update.

  • Right-click Start, click Run. In the Run dialog, type appwiz.cpl and click OK.
  • Click View installed updates on the left panel.
  • Sort the Windows Update installation history by “Installed on” column and find the problematic update which caused the error
  • uninstall windows update via programs and features

  • Select the update, and click Uninstall.
  • Restart Windows.

Fix 3: Repair System Files Corruption Using DISM and SFC

Open an elevated or admin Command Prompt window, and run the following command:

sfc /scannow

The System File Checker will run a thorough check of file integrity and automatically repairs all corrupt system files.

If, on the other hand, the System File Checker is unable to repair certain files, it shows the following error:

Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log %WinDir%\Logs\CBS\CBS.log.

sfc scannow cannot repair files

When analysing the CBS.log file,  you can find the exact file name(s) which could not be restored from the store:

<date>, Info CSI 00000008 [SR] Cannot 
repair member file [l:34{17}]"Accessibility.dll" of Accessibility, Version = 6.0.6000.16386, pA = PROCESSOR_ARCHITECTURE_MSIL (8), Culture neutral, VersionScope neutral, PublicKeyToken = {l:8 b:b03f5f7f11d50a3a}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing

In that case, you need to run the DISM tool to restore the system files to the component store, and then run the System File Checker tool again if necessary. The following is the DISM command-line you need to run:

DISM.exe /Online /Cleanup-image /Restorehealth

dism online restorehealth

For the command to be more effective, better option would be to run DISM mentioning the Install.wim image file as the source, obtained from the Windows 10 ISO. For detailed instructions, read article Repair Windows 10 Using DISM and SFC.

Restart the computer.

Fix 4: Perform System Restore Rollback

Windows 10 setup turns off System Restore by default. If you’ve already enabled System Restore, and lucky enough to have a suitable restore point available, you may try a rollback. Be sure to select a System Restore point that was created when the system was stable. (i.e., before the date when the “bad image” error first surfaced.)

Right-click Start, click Run. Type rstrui.exe and click OK. Pick the appropriate restore point, and rollback the system to a previous working state.

create restore point or rollback previous

For instructions, see post How to Create a Restore Point and Roll-back to a Previous Restore Point.

Hope one of the above fixes helped you solve the error 0xc000012f (“Bad Image”), without needing to do a clean installation of Windows.

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support, my reader. It won't take more than 10 seconds of your time. The share buttons are right below. :)

About the author

Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.

10 thoughts on “[Fix] Error Status 0xc000012f “Bad Image” When Running a Program”

  1. The command prompt didn’t work. Error says DISM does not support servicing Windows PE with the /Online option.
    The DISM log file can be found at X:\windows\logs\DISM\dism.log


Leave a Comment