home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!usc!rpi!usenet.coe.montana.edu!news.u.washington.edu!uw-beaver!ubc-cs!yogi
- From: yogi@cs.ubc.ca (Yossi Gil)
- Subject: Re: Another MsDos batch programming challenge
- Message-ID: <1992Aug29.152816.14977@cs.ubc.ca>
- Sender: usenet@cs.ubc.ca (Usenet News)
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- References: <1992Aug29.063552.26386@uwasa.fi>
- Date: Sat, 29 Aug 92 15:28:16 GMT
- Lines: 24
-
- ts@uwasa.fi (Timo Salmi) writes:
-
- >I have another MsDos batch programming challenge for you (I already
- >have a solution). Write a batch that returns (sets an environment
- >variable) to give the current directory. Only MsDos internal and
- >external commands are allowed. (The MsDos command.com command
- >interpreter is to be assumed. Not 4DOS, not DRDOS.)
-
- Following my tradition of suggesting dirty tricks here is my 3
- lines version:
-
- cd >> %0
- echo echo %%set%% >> %0
- set set=^Z
-
- (The above should be invoked with the .BAT extension. It should
- be quite easy to remove this restriction)
-
-
- --
- Joseph (Yossi) Gil {alberta,uw-beaver,uunet}!ubc-cs!yogi
- Dept. of Computer Science yogi@cs.ubc.ca (cs.ubc.ca=137.82.8.5)
- 6356 Agricultural Road., Univ. of B.C., Tel: +1-604-822-8175
- Vancouver, British Columbia, V6T 1Z2, Canada. Fax: +1-604-822-5485
-