DOS stub

2026-09-10

A DOS stub is a small 16-bit program embedded at the beginning of a Windows Portable Executable (PE) file that prints a compatibility warning and exits if run in MS-DOS.

This feature was built for backward compatibility during the transition from MS-DOS to Windows, preventing older systems from crashing by gracefully stopping execution rather than attempting to load an incompatible piece of software and potentially crashing the system.