Article View: comp.os.msdos.programmer
Article #1158Re: Another MsDos batch programming challenge
From: Steve Resnick
Date: Mon, 31 Aug 1992 19:17
Date: Mon, 31 Aug 1992 19:17
36 lines
1667 bytes
1667 bytes
In article <1992Aug29.152816.14977@cs.ubc.ca> yogi@cs.ubc.ca (Yossi Gil) writes: >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) Didn't work for me ... I'm using DOS 5.0 - just plain old DOS' command.com. This is the output, when I run FOO.BAT: cd >> foo.bat echo echo %set% >> foo.bat set set= Cheers! Steve -- ------------------------------------------------------------------------------ Steve Resnick - resnicks@netcom.com steve@axebbs.kludge.com FidoNet: 1:143/105 "Sometimes you're the windshield, sometimes you're the bug." - M. Knopfler -----------------------------------------------------------------------------
Technical Details
Message-ID:
<qzhn!6f.resnicks@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!hal.com!decwrl!csus.edu!netcom.com!resnicksReferences:
<1992Aug29.063552.26386@uwasa.fi> <1992Aug29.152816.14977@cs.ubc.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!hal.com!decwrl!csus.edu!netcom.com!resnicks From: resnicks@netcom.com (Steve Resnick) Newsgroups: comp.os.msdos.programmer Subject: Re: Another MsDos batch programming challenge Message-ID: <qzhn!6f.resnicks@netcom.com> Date: 31 Aug 92 19:17:03 GMT References: <1992Aug29.063552.26386@uwasa.fi> <1992Aug29.152816.14977@cs.ubc.ca> Organization: What? Me organized? You should see my checkbook! Lines: 36