[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How can I check (and run) if an *.exe is a DOS or a Windows program?



On Sat, Jan 7, 2023 at 6:43 PM Miguel A. Vallejo <ea4eoz@gmail.com> wrote:
>
> If I remember correctly, all Windows EXE have an string saying:
>
> This program cannot be run in DOS mode.

A couple of small nits...

They are called PE/PE+ programs. The string "This program cannot be
run in DOS mode" is called the MS-DOS Stub. It may or may not be
present. Most of the time it is present, but it is possible to build
an exe using the assembler without the message.

The first part of a PE program usually includes a DOS 2.0 header. The
DOS header allows the program to display the stub message under DOS
and exit.

Also see https://learn.microsoft.com/en-us/windows/win32/debug/pe-format.

Jeff


Reply to: