Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!ginosko!usc!srhqla!nrcvax!rick From: rick@NRC.COM (Rick Wagner) Newsgroups: comp.sys.ibm.pc Subject: Re: .COM and .EXE files Message-ID: <388@nrcvax.NRC.COM> Date: 23 Oct 89 19:29:49 GMT References: <4263@ncsuvx.ncsu.edu> Reply-To: rick@nrcvax.UUCP (Rick Wagner) Organization: Network Research Corp., Oxnard CA Lines: 38 In article <4263@ncsuvx.ncsu.edu> unkydave@shumv1.uucp (David Bank) writes: > > Actually, COMMAND.COM (the parser) recognizes THREE file extension. >".COM", ".EXE", and ".BAT" > > When you enter a command at the command line. DOS first checks to >see if it is an internal command ("CLS" or "VER" for example). > > If not, it then checks to see if the command was the name of a >".COM" file. After that, ".EXE" and finally ".BAT" > > If nothing comes back, it's time for "bad command or filename" > >Unky Dave >unkydave@shumv1.ncsu.edu The annoying thing is that it will ignore an explicit extension, using just the root part of the name, and following the search rules above. Once I tried to write a batch file "PLAY.BAT" which would decompress a game file into a temp. directory, and run the program. I wanted the ability to optionally include another batch file in the archive (ZIP-hive?;)), which would do any unique setup and cleanup for the game (such as updating the score file back into to the archive). What I intended was to be able to type PLAY X. Using a a set of searchs on "X", if it found that "X.ARC", or "X.ZIP", etc, existed, it would un-archive it. If the un-archiving yielded a file "X.BAT", it would explicitly run that. Typically the "X.BAT" file would run the game by explicit name ("X.EXE"), and then update the score file when the game finished. What I found instead was when PLAY.BAT tried to invoke X.BAT, explicitly giving the .BAT extension, COMMAND would strip off the .BAT, use its search list, and run the X.EXE file instead. Poop! --rick -- =============================================================================== Rick Wagner Network Research Corp. rick@nrc.com rick@nrcvax.UUCP 2380 North Rose Ave. (805) 485-2700 FAX: (805) 485-8204 Oxnard, CA 93030