home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 8911 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.6 KB

  1. Path: sparky!uunet!olivea!hal.com!decwrl!csus.edu!netcom.com!resnicks
  2. From: resnicks@netcom.com (Steve Resnick)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Another MsDos batch programming challenge
  5. Message-ID: <qzhn!6f.resnicks@netcom.com>
  6. Date: 31 Aug 92 19:17:03 GMT
  7. References: <1992Aug29.063552.26386@uwasa.fi> <1992Aug29.152816.14977@cs.ubc.ca>
  8. Organization: What? Me organized? You should see my checkbook!
  9. Lines: 36
  10.  
  11. In article <1992Aug29.152816.14977@cs.ubc.ca> yogi@cs.ubc.ca (Yossi Gil) writes:
  12. >ts@uwasa.fi (Timo Salmi) writes:
  13. >
  14. >>I have another MsDos batch programming challenge for you (I already
  15. >>have a solution).  Write a batch that returns (sets an environment
  16. >>variable) to give the current directory.  Only MsDos internal and
  17. >>external commands are allowed.  (The MsDos command.com command
  18. >>interpreter is to be assumed.  Not 4DOS, not DRDOS.)
  19. >
  20. >Following my tradition of suggesting dirty tricks here is my 3
  21. >lines version: 
  22. >
  23. >cd >> %0
  24. >echo echo %%set%% >> %0
  25. >set set=^Z
  26. >
  27. >(The above should be invoked with the .BAT extension. It should 
  28. >be quite easy to remove this restriction)
  29.  
  30. Didn't work for me ... I'm using DOS 5.0 - just plain old DOS' command.com.
  31.  
  32. This is the output, when I run FOO.BAT:
  33.  
  34.     cd >> foo.bat
  35.     echo echo %set% >> foo.bat
  36.     set set=
  37.  
  38.  
  39. Cheers!
  40. Steve
  41.  
  42. -- 
  43. ------------------------------------------------------------------------------
  44. Steve Resnick - resnicks@netcom.com steve@axebbs.kludge.com FidoNet: 1:143/105
  45. "Sometimes you're the windshield, sometimes you're the bug." - M. Knopfler
  46. -----------------------------------------------------------------------------
  47.