Error 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

What does Error Status 0xc000012f mean?

The error code 0xC000012F means STATUS_INVALID_IMAGE_NOT_MZ or “Bad image”, which means the specified image file did not have the correct format. It did not have an initial MZ.

Error 0xc000012f denotes that the program’s executable or one of the supporting modules is corrupt. The error 0xc000012f may occur in any version of Windows, and the fixes below apply to all versions, including Windows 10/11.

Resolution

Fix 1: Obtain a fresh copy of the DLL

Obtain a fresh copy of the DLL (named in the error message) from another system that has the same version of the DLL. Copy it to the affected computer. If you can’t copy it while Windows is running, try from Safe mode or Windows RE.

Fix 2: 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, and 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/11, 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.

Winword.exe Bad Image error and gfx.dll?

Some users have been receiving the “Bad Image” error when launching Microsoft Word (winword.exe). Here’s the full error message:

WINWORD.EXE - Bad Image

C:\Program Files\Microsoft Office\root\Office16\gfx.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 for support. Error status 0xc000012f.

winword.exe bad image error gfx.dll

The module name is usually gfx.dll. However, you may see a different module name in the error message dialog. Also, the “bad image” error can be seen when opening Excel, Outlook, or any other Office app.

The Winword.exe bad image error may be caused by one of the following antivirus programs you use:

  • Kaspersky End Point Security (KES)/Kaspersky Security Center/Kaspersky Network Agent.
  • McAfee antivirus software suite.

If disabling or completely uninstalling your antivirus (for testing purposes) fixes the “bad image” error, then you may need to check with the anti-virus software vendor for support. In some cases, adding the executable to the anti-virus exclusion list may work.

Users have indicated that completely removing all traces of McAfee/Kaspersky and Net Agent, then rebooting and running the “Online Repair” of Office installation has resolved the issue that was occurring with Word/Office.

word .docx and .doc files show generic white icon - repair office
Office installation repair options

Fix 3: Repair System Files Corruption Using DISM and SFC

If the DLL name mentioned is a Microsoft Windows DLL, then running the System File Checker should help.

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 repair all corrupt system files.



If, on the other hand, the System File Checker is unable to repair specific 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 analyzing 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, a better option would be to run DISM, mentioning the Install.wim image file as the source, obtained from the Windows ISO. For detailed instructions, see the article Repair Windows 10/11 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 are lucky enough to have a suitable restore point available, you may try a rollback. Be sure to select a System Restore point created when the system was stable. (i.e., before the “bad image” error first surfaced.)

Right-click Start, and click Run.

Type rstrui.exe and click OK.

Pick the appropriate restore point, and roll back the system to a previous working state.

create restore point or rollback previous

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

I 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. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

9 thoughts on “Error 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

    Reply
  2. Locate the Dll File and Delete it. Then Go to the web and download that Dll file and paste the file in previous location. This is the easiest solution. : )

    Reply

Leave a Comment