Path: utzoo!attcan!lsuc!maccs!cs4g6ag From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc Subject: Re: .COM and .EXE files Message-ID: <254A1EE4.6157@maccs.dcss.mcmaster.ca> Date: 28 Oct 89 21:49:23 GMT Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Organization: McMaster University, Hamilton, Ontario Lines: 37 In article <270@wsl.UUCP> john@wsl.ie (John Allen on wsl) writes: $The loader in COMMAND.COM is only used on two occasions:- $ 1. When issuing a command at the prompt. (it also recogizes .BAT) No, that's handled by the transient part of COMMAND. $ 2. When execing COMMAND with a /C The loader in COMMAND.COM (which stays resident once you've run COMMAND.COM/P) loads all .EXEs and may load .COMs, too (I'm not sure on that count, since all you have to do for them is load them straight from disk to memory). This is the case for DOS versions prior to 4. In DOS 4, they must have migrated the loader down one step into DOS, as you can install .EXEs from the config.sys file, which you could not do previously. $The MS-DOS exec/load program functiion call will load the file specified $and execute it. This function requires the full path name. Therefore any $program that provides a shell out faciltiy must use the COMSPEC environment $variable or (very bad programming) hard code the name "COMMAND.COM" directly $into the app. All programs that shell out do not necessarily use COMMAND.COM. Yes, this function requires the full path name because the entity which implements the PATH (that being the transient part of COMMAND.COM) may not be there every time the exec function is called. Hard-coding COMMAND.COM in is bad programming for more than one reason: 1. Someone may have renamed COMMAND.COM 2. The person may not be using COMMAND.COM 3. If we are not currently in the root directory of the boot disk, this will fail unless you search for COMMAND.COM on all of the machine's hard disks ... this will fail if it was booted from a floppy ... -- Stephen M. Dunn cs4g6ag@maccs.dcss.mcmaster.ca = "\nI'm only an undergraduate!!!\n"; ************************************************************************** ... but I'm too full to swallow my pride ...