Article View: net.micro.pc
Article #5519Re: Re: where are you after a batch file
From: Glen Shires
Date: Thu, 30 Jan 1986 18:01
Date: Thu, 30 Jan 1986 18:01
43 lines
2206 bytes
2206 bytes
> > Where are you after a batch file completes? Wherever it chooses to leave
> > you. Where do you want to be? Back where you started. How can you get
> > there automatically?
> > ...
> In pc-dos 2.1 - if you do a cd in the .bat file you are left in that
> directory, otherwise you stay in the same directory. (Am I missing something?)
>
> > John Higley
> > ...tektronix!tekig5!johnhi
>
> --henry schaffer
Often you can get around this by specifying a programs full path name like:
c:\yourdir\yourfile
Also, you can use the DOS "PATH=c:\;c:\yourdir" command
But not always...
For those programs that must run with the current directory elsewhere
here's a hack around your problem:
create a dummy skeleton file in root CDMSG.BAT containing only
"CD "
(CD<space>) NO CARRIAGE RETURN
then put in your batch file:
copy c:\cdmsg.bat c:\zap.bat copy "CD " shell into zap.bat
cd >>c:\zap.bat add current directory "CD C:\NOW\HERE"
cd where\ever\you\want\to\go now change directories freely
yourprog and execute your programs
c:\zap.bat now go back to original directory
del c:\zap.bat and delete temp file
NOTE: you do not have to place CDMSG.BAT and ZAP.BAT in your root directory,
but you must always place it in the same directory and specify a full
path name
--
^ ^ Glen Shires, Intel, Santa Clara, Ca.
O O Usenet: {ucbvax!amd,pur-ee,hplabs}!intelca!glen
> ARPA: "amd!intelca!glen"@BERKELEY
\-/ --- stay mellow
Technical Details
Message-ID:
<203@intelca.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!sun!idi!intelca!glenReferences:
<440@tekig5.UUCP> <1130@ecsvax.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/13/84; site intelca.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!sun!idi!intelca!glen From: glen@intelca.UUCP (Glen Shires) Newsgroups: net.micro.pc Subject: Re: Re: where are you after a batch file Message-ID: <203@intelca.UUCP> Date: Thu, 30-Jan-86 13:01:01 EST Article-I.D.: intelca.203 Posted: Thu Jan 30 13:01:01 1986 Date-Received: Sat, 1-Feb-86 05:57:29 EST References: <440@tekig5.UUCP> <1130@ecsvax.UUCP> Organization: Intel, Santa Clara, Ca. Lines: 43