On 19 Jan 2001 11:08:12 EST, David Ratti wrote:

> Sam -

> What happens if you also have a file named BASIC.BAT in the same directory?
> Which one runs in that case?

> Dave

Hello Dave:

The order of precedence is COM, EXE, BAT.

As I recall, MS-DOS 3.30 came supplied with a BASIC.COM and a BASIC.EXE.
To invoke BASIC, one would simply type "basic" on the command line.  The
BASIC.COM program would run and then immediately call BASIC.EXE.

BTW, may you all be warned that some virus programs are designed to copy
an evil COM program into a directory where you have a legitimate EXE by the
same name.  Also anyone who is out to get even with you, and if he has access
to your computer, he can easily accomplish his mission simply by copying an
evil COM program into a directory where you have a legitimate EXE having the
same name.  Most virus scanners do not warn you of this situation, and the
evil COM would not necessarily be recognized as a virus.  A person with very
few computer skills can easily write a tiny little evil COM program that
would not be seen as a virus.  The accursed COM will not trigger until the
next time you attempt to run your EXE.  Your computer will surely get trashed
if you are ignorant of the existence of the evil COM program.  For this
reason, we should be suspicious of any situation where we find COM programs
and EXE programs having the same name.  In a few cases, this is perfectly
legitimate, but beware!

All the best,

Sam Heywood


> "Samuel W. Heywood" <[EMAIL PROTECTED]> wrote:
> On Thu, 18 Jan 2001 01:36:42 -0400, Clarence Verge wrote:

>> Hello All;

>> Or wrote something about DOS not caring about file extensions.

>> I wrote some (mostly true) crap about the difference between .com
>> and .exe.

>> It turns out that in 20 years of using this DOS based stuff I had
>> never tried to just swap the extensions and see what happens.
>> Actually, it STILL seems like a dumb thing to do, and without some
>> prodding from Glenn I would still be quite happy in my ignorance.

>> Regardless of the different internal formats, in all versions of
>> DOSs tested from PC3.3 to MS6.22 and Glenn's newkid XXX, programs
>> load and run perfectly even if you swap the exe and com extensions.

> I think this discussion should include mention of the fact that an
> executable file having a COM extension will be found and executed
> *before* a file with the same name having a EXE extension.  (i.e.,
> if for example you have a program named BASIC.COM and also one named
> BASIC.EXE in your C:\DOS directory, and C:\DOS is included in your
> path variable, and if you type in the word "basic" at the command line,
> then BASIC.COM is the program that will be executed.)

> Sam Heywood
> ____________________________________________________________________

-- This mail sent by Arachne, www graphical browser for DOS
-- Visit the Arachne DOS Browser Home Page, http://home.arachne.cz

Reply via email to