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