Path: utzoo!attcan!uunet!mcsun!cernvax!chx400!urz.unibas.ch!fritz From: fritz@urz.unibas.ch Newsgroups: comp.windows.ms Subject: Re: How may I automatically run a batch upon startup of DOS shell? Message-ID: <1990Nov15.144909.1179@urz.unibas.ch> Date: 15 Nov 90 13:49:08 GMT References: <1990Nov5.100924.27076@agate.berkeley.edu> <2310@sparko.gwu.edu> Distribution: comp.windows.ms Organization: University of Basel, Switzerland Lines: 52 In article <2310@sparko.gwu.edu>, timur@seas.gwu.edu (The Time Traveler) writes: > In article <1990Nov5.100924.27076@agate.berkeley.edu> c60c-3fz@e260-3f.berkeley.edu (In Sik Rhee) writes: >>Ok, here's the way to do it (tricky, but works) >> >>you're gonna create 2 batch files... in the first one, lets call it dos.bat, >>you type in the name of the second batch file (Don't CALL it, just execute >>it). The second batch file is the one you will want to run... so for ex. >> >>DOS.BAT will have: >> @echo off >> go >> >>and GO.BAT will have what you want to do... it'll give you a prompt after >>go.bat is finished... I forget the exact reason why it does this, but it's >>gotta do something with having to "CALL" a batch file from within a batch >>file... anyway, it works, so why complain :) > > I tried this, and I can't get it to work. I told the .PIF file to load > DOS.BAT, and then I tried loading COMMAND.COM /C DOS.BAT, and that didn't > work either. > > In both cases, it opens and closes the DOS window. And at 25Mhz, I can't > even see what it's doing!!! > The problem with the /C qualifier of COMMAND.COM is that immediately after execution of the command line specified after /C the COMMAND shell is closed and you're back in your WINDOWS environment. Nevertheless you can use the whole thing very well. Here is an example how I use it: I run emTeX as a DOS application. I need to have extended environment memory because I need to set some variables (%TEXINPUT% etc...). So I write in the .pif file: COMMAND /E:512 /C emtex.bat The EMTEX.BAT itself contains the following lines: @echo off call set-tex.bat (* sets all the variables *) ncsmall When I execute the .pif file it calls emtex.bat and emtex.bat calls the Norton Commander, which is very convenient when you want to work with emTeX. When I leave ncsmall (F10) I return immediately to windows because now the emtex.bat is "over". I hope someone can use this rather complicated procedure too. Good luck. Oliver Fritz, University of Basel, Switzerland