General discussion

Locked

Dos commands

By chetdavs ·
If I had three files all named the same and placed in the root directory, which order would they follow if the extensions were .com, .exe, and .bat.? Example: run.com, run.bat, and run.exe.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Dos commands

by TheChas In reply to Dos commands

I put all my DOS books away in storage.

The hierarchy of the extensions is:

.com
.exe
.bat

What I'm not sure about, is if you simply type your file name (run) and press enter, will DOS follow the hierarchy, or will it execute the first program that it finds.

I know that DOS does display files by the date they were added to the directory unless a directory sort has been performed, and then, the files will be listed in the order defined by the sort.

In the DOS de-fragmenter programs, you had the option to sort the files in specific orders.

So, it is either by the hierarchy, or the order the files are listed in the FAT.

If you need to assure that the programs are always executed in a specific order, you will need to usea batch file that lists them in the sequence desired.

If I find my DOS books before you get a better answer, I will add a comment.

Chas

Collapse -

Dos commands

by chetdavs In reply to Dos commands

Poster rated this answer

Collapse -

Dos commands

by Ann777 In reply to Dos commands

http://www.dcs.napier.ac.uk/~tim/css/tut5/tut5.htm


See the above

Section 1 --> number 2:

"if it is not an internal command then the command interpreter looks in the current directory for a file with same name as the command and the extension bat. If it does not find this it then tries extension com and then exe. If it finds the appropriate file it assumes it stores a program, loads it into memory and executes it. (Note: if the command name includes an extension bat, com or exe then this will override the search order given above.)

Please remove any embedded spaces from the above link when pasting it into your browser. There are many more tutorials linked from the above tut.

Collapse -

Dos commands

by chetdavs In reply to Dos commands

Poster rated this answer

Collapse -

Dos commands

by fenaikh In reply to Dos commands

Hi
I gues you ment which will execute first then the answer is:

1. run.bat
2. run.com
3. run.exe


Good luck


Mohamed

Collapse -

Dos commands

by chetdavs In reply to Dos commands

Poster rated this answer

Collapse -

Dos commands

by chetdavs In reply to Dos commands

This question was closed by the author

Back to Desktop Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums