Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!ll-xn!cit-vax!tybalt.caltech.edu!li From: li@tybalt.caltech.edu.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Help with directories and batch files... Message-ID: <2099@cit-vax.Caltech.Edu> Date: Fri, 20-Mar-87 15:30:52 EST Article-I.D.: cit-vax.2099 Posted: Fri Mar 20 15:30:52 1987 Date-Received: Sun, 22-Mar-87 21:20:16 EST References: <4471@columbia.UUCP> <3381@iuvax.UUCP> Sender: news@cit-vax.Caltech.Edu Reply-To: li@tybalt.caltech.edu.UUCP (James C. Li) Organization: Calfornia Institute of Technology Lines: 41 In article <3381@iuvax.UUCP> bobmon@iuvax.UUCP (Che Flamingo) writes: >x1.micky@cu20b.columbia.edu (Micky Liu) writes: >> >>I am trying to use a batch file to: >> >>1) save the current directory >>2) goto another directory >>3) execute some program >>4) return to saved directory There is a simple way to do something similar to this, although it really isn't a solution, just a patch, but it doesn't take too much effort, and may be adequate for what you want. Use the SUBST command to assign a logical drive, say x:(assuming you have included a line "lastdrive=z" in your config.sys) to the other directory you want(or just the same drive and feed it the path). Then change drives(just "x:"). DOS remembers the current directory in each drive, so when you come back c:(assuming you just work off c:, otherwise, this won't work), you will still be in the old directory. I have used the same trick to do a whereis on just a subdirectory tree. The public domain version of whereis we have searches the entire disk(if there is another version that accepts a path, I'd like to hear about it.) The batch file looked something like the following: if "%2" == "" goto usage subst x: %2 x: whereis %1 c: subst x: /d goto end :usage echo Usage: whis file path :end li@tybalt.caltech.edu (James Li) __ __ (also li@citromeo.caltech.bitnet) | | "Official KANK symbol" ------> | |