Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!amdahl!bnrmtv!perkins From: perkins@bnrmtv.UUCP (Henry Perkins) Newsgroups: comp.sys.ibm.pc Subject: Re: Help with directories and batch files... Message-ID: <1523@bnrmtv.UUCP> Date: Wed, 18-Mar-87 00:08:02 EST Article-I.D.: bnrmtv.1523 Posted: Wed Mar 18 00:08:02 1987 Date-Received: Thu, 19-Mar-87 05:29:01 EST References: <4471@columbia.UUCP> Organization: BNR Inc., Mountain View, California Lines: 29 > 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 > > Micky Liu ...seismo!columbia!flims!m-liu Create a file called CDSTRING on a path I'll represent as diskname:\cdstringpath\CDSTRING which contains only this text, not including the quotes: "CD " Then your batch can look like the following: COPY diskname:\cdstringpath\CDSTRING diskname:\popdirpath\POPDIR.BAT CD >> diskname:\POPDIR.BAT CD diskname:\whatever\path\you\need progname diskname:\popdirpath\POPDIR On DOS versions before 3.0, you'd need to have diskname:\popdirpath in your search path, and remove it from in front of the POPDIR in the last line. -- {hplabs,amdahl,3comvax}!bnrmtv!perkins --Henry Perkins It is better never to have been born. But who among us has such luck? One in a million, perhaps.