Article View: comp.sys.ibm.pc.programmer
Article #464Re: Current directory from batch file
From: Bill Svirsky
Date: Wed, 09 May 1990 16:04
Date: Wed, 09 May 1990 16:04
29 lines
1583 bytes
1583 bytes
In article <90May7.072047edt.19230@me.utoronto.ca> sun@me.utoronto.ca (Andy Sun Anu-guest) writes:
+I thought what the original poster asked was:
+
+(1) say, you are in C:\DIR1
+(2) you execute a batch file which have a lot of CDs so that at the end
+ of the batch file, you end up in, say, C:\DIR2\DIR3\DIR4.
+(3) upon terminate of the batch file, you need to go back to C:\DIR1
+ automatically.
+
+I couldn't think of any combination of genuine DOS commands that can
+accomplish that task.
Suppose you have a file, call it 'cd.cmd', that contains just 'cd ' (no
end-of-line). Then you could do something like:
copy c:\cd.cmd c:\savedir.bat
cd >> c:\savedir.bat
...
... batch commands here
...
c:\savedir.bat
To get a file, such as 'cd.cmd', that doesn't contain an end-of-line, use:
copy con c:\cd.cmd
cd ^Z<enter>
--
Bill Svirsky, Citicorp+TTI, 3100 Ocean Park Blvd., Santa Monica, CA 90405
Work phone: 213-450-9111 x2597
svirsky@ttidca.tti.com | ...!{csun,psivax,rdlvax,retix}!ttidca!svirsky
Technical Details
Message-ID:
<13103@ttidca.TTI.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!srhqla!quad1!ttidca!svirskyReferences:
<90122.175401MCCABE@MTUS5.BITNET> <10153.26405d35@vax1.cc.lehigh.edu> <1873@gannet.cl.cam.ac.uk> <90May7.072047edt.19230@me.utoronto.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!srhqla!quad1!ttidca!svirsky From: svirsky@ttidca.TTI.COM (Bill Svirsky) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Current directory from batch file Message-ID: <13103@ttidca.TTI.COM> Date: 9 May 90 16:04:50 GMT References: <90122.175401MCCABE@MTUS5.BITNET> <10153.26405d35@vax1.cc.lehigh.edu> <1873@gannet.cl.cam.ac.uk> <90May7.072047edt.19230@me.utoronto.ca> Organization: Citicorp/TTI, Santa Monica Lines: 29