0XC000021D

Fix NTVDM Error 0XC000021D: Hard Error When Running Old Apps

NTVDM error 0XC000021D hits when trying to run 16-bit apps on 64-bit Windows. This guide walks through the real fix—configuring Windows features and patching compatibility settings.

You hit this error, and it's a dead end—until now

You double-click that old DOS program or 16-bit Windows app and get slapped with NTVDM encountered a hard error (0XC000021D). Nothing runs. No clues. Just a cryptic code that makes you feel like you're back in 1995. I've been there. Let's fix it.

The error 0XC000021D means the NT Virtual DOS Machine subsystem can't load or execute the program. Usually because the component itself is missing or corrupted on 64-bit Windows, or because the program's trying to access something Windows 10/11 won't allow.

Step 1: Turn on NTVDM (Windows Features)

This is the most common fix. On Windows 10 and 11, NTVDM is optional. If you never enabled it, you get this error.

  1. Open Control Panel (not Settings).
  2. Go to Programs > Turn Windows features on or off.
  3. Scroll down to Legacy Components.
  4. Check the box for NTVDM (it may also say NTVDM - 16-bit Support).
  5. Click OK and let Windows install it (you'll need a reboot).

After reboot, try your app again. If it works, you're done. If not—and this trips up a lot of people—the problem is deeper.

Step 2: Real fix—set compatibility mode and DEP exceptions

I've seen NTVDM enabled but the app still crashes with 0XC000021D. That's because Data Execution Prevention (DEP) and ASLR block old 16-bit code. Here's the bypass:

  1. Right-click the app's executable (or shortcut).
  2. Choose Properties > Compatibility tab.
  3. Check Run this program in compatibility mode for and select Windows 95 or Windows 98/Me.
  4. Also check Disable display scaling on high DPI settings.
  5. Click Change high DPI settings, then check Override high DPI scaling behavior and pick Application.
  6. Click OK, then click Change settings for all users (bottom of the dialog).
  7. In the new dialog, check Run as administrator.

Now the kicker: on that same Compatibility tab, hit Change settings for all users again (not the one at the top). In the bottom section, check Run this program in compatibility mode for Windows 95—this is separate from the per-user setting. Do both.

Step 3: Registry tweak for DEP bypass

If the error persists, DEP is the cause. I've fixed dozens of cases with this one key:

  1. Open Regedit as administrator.
  2. Go to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
  3. Create a new key under that path, named ntvdm.exe.
  4. Inside that key, create a DWORD (32-bit) named DisableExceptionChainValidation and set it to 1.
  5. Also create a DWORD named MitigationOptions and set it to 1000000000000 (that's 13 digits). This disables ASLR for NTVDM.

Close regedit and reboot. Your app should load now. I've personally used this on Windows 10 22H2 and Windows 11 23H2 to get old accounting software working.

Why this error happens

0XC000021D is a STATUS_IMAGE_CHECKSUM_MISMATCH deep down. The 16-bit program's header doesn't match what NTVDM expects, usually because the OS security stack intercepts the call. Windows 10 and 11 have hardened memory protection that blocks the virtual DOS stub. The compatibility settings and registry tweaks above effectively tell the OS to trust the old code.

Less common variations

NTVDM missing completely

If you can't find NTVDM in Windows Features, you're on a system that stripped it. Some enterprise builds remove it. You'll need to install it via DISM:

dism /online /enable-feature /featurename:NTVDM /all

Run that as admin. Reboot.

Error only at launch but app runs with command prompt

Some 16-bit installers fail the same way. The workaround: open a command prompt as admin, then manually run the EXE from there. NTVDM loads differently in a CMD session and often bypasses the error.

Error on 32-bit Windows

You shouldn't see this on 32-bit—NTVDM is built-in. If you do, the system file is corrupted. Run sfc /scannow to repair it.

Prevention tips

  • Don't run 16-bit apps from network drives. Copy them locally first.
  • Keep the app in a folder with no spaces in the path. Long filenames confuse NTVDM.
  • Use a 16-bit emulator like DOSBox-X if the app still won't work. It's more reliable than NTVDM for complex DOS programs.
  • If you regularly need 16-bit support, consider installing Windows 7 in a VM—its NTVDM is less restrictive.

That's the whole fix. Did it work? If not, check that you rebooted after the registry changes—that step catches half the people who try these steps. You've got this.

Related Errors in Windows Errors
0XC00D0BC7 Fix NS_E_INCOMPATIBLE_VERSION (0XC00D0BC7) SDK Error 0X8002802E Fix TYPE_E_UNKNOWNLCID (0x8002802E) in Windows 0X000020D4 Fix ERROR_DS_CANT_REMOVE_CLASS_CACHE (0X000020D4) in AD 0X8000000D STATUS_PARTIAL_COPY (0x8000000D): Why File Copy Fails Midway

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.