home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / msdos / programm / 9323 < prev    next >
Encoding:
Text File  |  1992-09-12  |  1.2 KB  |  42 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!drivax!liberato
  3. From: liberato@dri.com (Jimmy Liberato)
  4. Subject: Re: Another MsDos batch programming challenge
  5. Message-ID: <FRDQB0DG@dri.com>
  6. Reply-To: liberato@dri.com (Jimmy Liberato)
  7. Organization: Novell/Desktop Systems Group, Monterey Development Center
  8. References: <1992Aug29.063552.26386@uwasa.fi> <1992Aug29.152816.14977@cs.ubc.ca>
  9. Date: Sun, 13 Sep 92 04:17:03 GMT
  10. Lines: 30
  11.  
  12. yogi@cs.ubc.ca (Yossi Gil) writes:
  13.  
  14. >ts@uwasa.fi (Timo Salmi) writes:
  15. >
  16. >>...
  17. >>Write a batch that returns (sets an environment
  18. >>variable) to give the current directory. 
  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. This is very clever but doesn't its self-modifying behavior cause it 
  31. to fail after one use?  (The location of the end-of-file marker, ^Z, 
  32. is important in your scenario.)  And wouldn't CD be a better environment 
  33. variable name than SET?  In any case, I can't come up with something
  34. that works even once! :-(
  35.  
  36. --
  37. Jimmy Liberato   liberato@dri.com
  38.                  ...uunet!drivax!liberato
  39.  
  40.  
  41.  
  42.