from Sam Heywood:
> Regarding the behavior of executables running in DOS, it doesn't
matter whether the file has a COM, EXE, or BAT extension. If you type
the name of the file at the command prompt and omit the file extension
and then press enter, the program will run if it is in the search path.
I think you are already well aware of that, Thomas. I don't know why
you could ask the same question regarding DOS. Maybe I misunderstood
your question. BTW, if you rename a DOS program being a COM file or an
EXE file to a BAT file and then try to run it in DOS, some parts of
the program might run in some buggy fashion. I have found this out by
experimentation. Is this what you really wanted to know about? Well,
I have told you what happens. I don't know if it is safe in all cases
to conduct such experiments.
I knew DOS would run a .COM even if it were named .EXE, or an .EXE even if it
were named .COM, but didn't really know if that extended to .BAT. DOS will run
an .EXE in preference to a .BAT or will run a .COM in preference to an .EXE or
.BAT regardless of file name extension typed at the command line, as far as I
know. I never tried to run an .EXE file misnamed .BAT. But I think DOS would
not recognize .SCR or .PIF.
I received one Snowhite message with a base64-encoded attachment midgets.scr,
so I extracted it, thinking it might be a script file readable as plain text.
I found it was a non-text file but began with MZ, which I recognized as the
first two characters of an .EXE file. Subsequently I solved the puzzle of how
COMMAND.COM in some cases, or some .COM files in OS/2, could exceed 65536 bytes.
They were really misnamed .EXE files.
Actually it would be possible though not usual for a text file or legitimate
.BAT file to begin with MZ.