home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8637 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1018 b   |  29 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!destroyer!ubc-cs!unixg.ubc.ca!unixg.ubc.ca!israel
  3. From: israel@unixg.ubc.ca (Robert B. Israel)
  4. Subject: Re: Batch programming puzzle
  5. Message-ID: <israel.714265510@unixg.ubc.ca>
  6. Sender: news@unixg.ubc.ca (Usenet News Maintenance)
  7. Nntp-Posting-Host: unixg.ubc.ca
  8. Organization: University of British Columbia, Vancouver, B.C., Canada
  9. Date: Wed, 19 Aug 1992 23:05:10 GMT
  10. Lines: 17
  11.  
  12. Here's another approach, which works in versions of DOS from 2.1 to 5
  13. (tricks like echo.ext and appending to a batch file while it's
  14. running do not).  
  15.  
  16.      del &&temp1.*
  17.  REM  better not have any files you want to keep with this name!
  18.      copy %1 &&temp1.*
  19.      dir &&temp1.* | find "&&TEMP1" > &&temp2.bat
  20.      echo set ext=%%1 > &&temp1.bat
  21.      echo del &&temp?.* >>&&temp1.bat
  22.      &&temp2
  23.  
  24. -- 
  25. Robert Israel                            israel@math.ubc.ca
  26. Department of Mathematics             or israel@unixg.ubc.ca
  27. University of British Columbia
  28. Vancouver, BC, Canada V6T 1Y4
  29.