Article View: comp.sys.ibm.pc.programmer
Article #418Re: Current directory from batch file
From: Raymond Chen
Date: Tue, 08 May 1990 00:32
Date: Tue, 08 May 1990 00:32
20 lines
1444 bytes
1444 bytes
In article <90May7.072047edt.19230@me.utoronto.ca> sun@me.utoronto.ca (Andy Sun Anu-guest) writes: >I couldn't think of any combination of genuine DOS commands that can >accomplish that task. Closing my eyes and thinking real hard, I came up with this: Create a file that contains three characters. "c" "d" <space>. No trailing CR+LF! Put it in \usr\lib\cdspace Your batch file does this: copy \usr\lib\cdspace \tmp\cdspace.bat cd >>\tmp\cdspace.bat ... do whatever you want ... \tmp\cdspace Doesn't use the "call" command, so should even work on DOS 2.0. If you're clever, you can even teach cdspace.bat to erase itself when it's done, but it's no big deal leaving it in the \tmp directory, since everybody has a "del \tmp\*.*" in their autoexec.bat, right? :-)
Technical Details
Message-ID:
<1990May8.003238.6922@agate.berkeley.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!agate!pepto-bismol!raymondReferences:
<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!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!agate!pepto-bismol!raymond From: raymond@pepto-bismol.berkeley.edu (Raymond Chen) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Current directory from batch file Message-ID: <1990May8.003238.6922@agate.berkeley.edu> Date: 8 May 90 00:32:38 GMT References: <90122.175401MCCABE@MTUS5.BITNET> <10153.26405d35@vax1.cc.lehigh.edu> <1873@gannet.cl.cam.ac.uk> <90May7.072047edt.19230@me.utoronto.ca> Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Reply-To: raymond@pepto-bismol.UUCP (Raymond Chen) Organization: U.C. Berkeley Lines: 20