home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 8871 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.3 KB  |  36 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!usc!rpi!usenet.coe.montana.edu!news.u.washington.edu!uw-beaver!ubc-cs!yogi
  3. From: yogi@cs.ubc.ca (Yossi Gil)
  4. Subject: Re: Another MsDos batch programming challenge
  5. Message-ID: <1992Aug29.152816.14977@cs.ubc.ca>
  6. Sender: usenet@cs.ubc.ca (Usenet News)
  7. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  8. References: <1992Aug29.063552.26386@uwasa.fi>
  9. Date: Sat, 29 Aug 92 15:28:16 GMT
  10. Lines: 24
  11.  
  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.  
  31. --
  32. Joseph (Yossi) Gil                 {alberta,uw-beaver,uunet}!ubc-cs!yogi
  33. Dept. of Computer Science          yogi@cs.ubc.ca (cs.ubc.ca=137.82.8.5)
  34. 6356 Agricultural Road., Univ. of B.C.,             Tel: +1-604-822-8175
  35. Vancouver, British Columbia, V6T 1Z2, Canada.       Fax: +1-604-822-5485
  36.