Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rpics!chassin From: chassin@rpics.RPI.EDU (Dave Chassin) Newsgroups: comp.sys.ibm.pc Subject: Re: Help with directories and batch files... Message-ID: <1009@rpics.RPI.EDU> Date: Wed, 18-Mar-87 16:50:53 EST Article-I.D.: rpics.1009 Posted: Wed Mar 18 16:50:53 1987 Date-Received: Fri, 20-Mar-87 01:44:31 EST References: <4471@columbia.UUCP> <838@bucsb.bu.edu.UUCP> <839@bucsb.bu.edu.UUCP> Lines: 39 Summary: It does work but... In article <839@bucsb.bu.edu.UUCP>, keast@bucsb.bu.edu.UUCP (Kenneth East) 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 [...] > > REM place a 'cd ' in the file old_dir.bat > copy \batch\cd.txt \batch\old_dir.bat > REM append the current directory path to the same file > cd >> \batch\old_dir.bat > REM now you can change directories at will and execute programs, etc. > cd \progs\etc > foo.exe > REM to return to the original directory, just execute the batch file > REM you created above: > \batch\old_dir.bat > REM and you are back at the original directory. > Yes this will work fine AS LONG AS you execute \batch\old_dir.bat last or as 'command /c \batch\old_dir.bat'... batch files exit otherwise and and following statements are skipped. Dave _____________________ David P. Chassin Rensselaer Polytechnic Institute | School of Architecture __+__ Troy, NY 12181 / _ \ USA | | | | /=======/ = \=======\ (518) 266-6461 | _ | _ | _ | | | | | | | | | | | chassin@csv.rpi.edu | = | | | | = | =======================================================================