Mail Archives: djgpp/1999/03/04/18:40:29
In article <mvparvia DOT 920579623 AT snakemail DOT hut DOT fi>, mvparvia AT delta DOT hut DOT fi
(Mikko V.I. Parviainen) wrote:
> [On copying bash.exe as command.com]
> locke AT mcs DOT net (Peter Johnson) writes:
> >Um.. that would be a BAD idea. Considering that command.com is NOT
> >an .exe file (.coms and .exes are loaded differently by DOS).
> Actually, I have the impression that command.com has been an exe file
> since at least MS-DOS 5.0. DOS determines the type of an executable
> from its internal structure, not file system name.
> If I recall correctly, one could run a file with any name as an
> .exe-file, if only all relevant data is in the right place.
> Mikko Parvianen
> pare AT iki DOT fi
Yes, just check the first two bytes of a program and if they
are "MZ" it will be loaded as a .EXE and if not then as a .COM
(the extensions only tell DOS that it is actually a program).
(I used to know whose initials M.Z. were)
If you take a .EXE an change one of those bytes DOS will
usually complain that the program is "too big to fit in
memory" (as .COM files have to be single segment so < 64k).
I don't have a PC handy at the moment to check COMMAND.
Also, if I remember correctly, DOS only uses the
environment variable to find the shell if it can't
locate it in the root directory of the boot drive
so simply moving COMMAND.COM to another location
should be enough (not tested though).
Bernard
--
Bernard P. Murray, PhD
Dept. Cell. Mol. Pharmacol., UCSF, San Francisco, USA
- Raw text -