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

  1. Path: sparky!uunet!dtix!darwin.sura.net!wupost!gumby!destroyer!ubc-cs!unixg.ubc.ca!unixg.ubc.ca!israel
  2. From: israel@unixg.ubc.ca (Robert B. Israel)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Another MsDos batch programming challenge
  5. Message-ID: <israel.715477510@unixg.ubc.ca>
  6. Date: 2 Sep 92 23:45:10 GMT
  7. References: <1992Aug29.063552.26386@uwasa.fi>  <1992Aug29.152816.14977@cs.ubc.ca> <qzhn!6f.resnicks@netcom.com> <92246.142230F13@psuvm.psu.edu>
  8. Sender: news@unixg.ubc.ca (Usenet News Maintenance)
  9. Organization: University of British Columbia, Vancouver, B.C., Canada
  10. Lines: 47
  11. Nntp-Posting-Host: unixg.ubc.ca
  12.  
  13. In <92246.142230F13@psuvm.psu.edu> Kevin <F13@psuvm.psu.edu> writes:
  14.  
  15. >In article <qzhn!6f.resnicks@netcom.com>, resnicks@netcom.com (Steve Resnick)
  16. >says:
  17. >>In article <1992Aug29.152816.14977@cs.ubc.ca> yogi@cs.ubc.ca (Yossi Gil)      :
  18. >>writes
  19. >>>ts@uwasa.fi (Timo Salmi) writes:
  20. >>>
  21. >>>Following my tradition of suggesting dirty tricks here is my 3
  22. >>>lines version:
  23. >>>
  24. >>>cd >> %0
  25. >>>echo echo %%set%% >> %0
  26. >>>set set=^Z
  27. >>>
  28. >>This is the output, when I run FOO.BAT:
  29. >>        cd >> foo.bat
  30. >>        echo echo %set% >> foo.bat
  31. >>        set set=
  32. >>Cheers!
  33. >>Steve
  34.  
  35. >   Hello all !  I won't pretend to be a master of batch files (I have almost
  36. >no idea what the above two examples are doing) but I do know there is an
  37. >undocumented DOS command TRUENAME that returns the name of the current
  38. >directory.  Is there a way to set an environment variable to what this
  39. >returns ?  (TRUENAME is suppossed to be given a file name as an argument,
  40. >and it returns the full name of the file, by the way).
  41.  
  42. >Kevin Furrow (f13@psuvm.psu.edu)
  43.  
  44. TRUENAME does exist in DOS 5, but not in DOS 3.3.  In this case, though,
  45. you want CD (which only returns the name of the current directory), not
  46. TRUENAME (which returns directory+filename).
  47.  
  48. The whole point of the exercise is to find ways of setting environment
  49. variables to what a command returns.  In UNIX it would be easy, but in
  50. DOS you have to resort to tricks.
  51.  
  52. BTW, Yossi's solution should work if you run it as "FOO.BAT" rather than as
  53. "FOO".  
  54.  
  55. -- 
  56. Robert Israel                            israel@math.ubc.ca
  57. Department of Mathematics             or israel@unixg.ubc.ca
  58. University of British Columbia
  59. Vancouver, BC, Canada V6T 1Y4
  60.