Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!gitpyr!jkg From: jkg@gitpyr.gatech.EDU (Jim Greenlee) Newsgroups: comp.sys.ibm.pc Subject: Re: .bat files within extra command.com Message-ID: <2643@gitpyr.gatech.EDU> Date: Sun, 16-Nov-86 11:43:35 EST Article-I.D.: gitpyr.2643 Posted: Sun Nov 16 11:43:35 1986 Date-Received: Mon, 17-Nov-86 01:56:19 EST References: <10300005@uiucuxe> Reply-To: jkg@gitpyr.UUCP (Jim Greenlee) Organization: Georgia Institute of Technology Lines: 53 In article <10300005@uiucuxe> epb19@uiucuxe.CSO.UIUC.EDU writes: > >I am looking for someone who has experience in writing .bat files which run >from within other .bat files, expeciallly on systems in which certain programs >require the reloading of command.com after running the program. I know it is >possible to load the second command.com, and that it takes up extra RAM. >What I am looking for is a group of examples of how you have worked out ways >to do this, and which ways are easiest, fastest, least RAM intensive, etc. > The ordinary way to do this is to pass the name of the batch file as a parameter to COMMAND.COM. Also, COMMAND.COM must be invoked with the /C option so that it will go away after the batch file terminates. As an example, suppose you want to run the file FOO.BAT from within the file BIGFOO.BAT. You use the following to cause control to be returned to BIGFOO after FOO completes: . . [some commands] . . COMMAND/C FOO . . [more commands] . . I have used this trick numerous times and it works. You can also do nested FOR statements the same way like this: FOR %%I IN (...) DO COMMAND/C FOR %%J IN (...) DO MYPROG or to execute a batch file: FOR %%I IN (...) DO COMMAND/C FOR %%J IN (...) DO COMMAND/C FOO Each invocation of the command processor will take up a little more memory, but as long as all applications remember to pop their copy "off the stack", so to speak, you shouldn't have any problems. Of course, for this to work properly, you must have a copy of COMMAND.COM on the disk where the batch file is (for a floppy-based system) or it must be found in your current PATH (for a hard disk system). Jim Greenlee -- The Shadow...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!jkg Abj lbh'ir tbar naq qbar vg! Whfg unq gb xrrc svqqyvat jvgu vg hagvy lbh oebxr vg, qvqa'g lbh?!