🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1028

Re: Batch programming puzzle

#1028
From: Robert B. Israel
Date: Wed, 19 Aug 1992 23:05
17 lines
1046 bytes
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
Technical Details
Message-ID: <israel.714265510@unixg.ubc.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!ubc-cs!unixg.ubc.ca!unixg.ubc.ca!israel

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!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