Category : Files from Magazines
Archive   : VOL9N19.ZIP
Filename : REPL.BAT

 
Output of file : REPL.BAT contained in archive : VOL9N19.ZIP
[[REPL.BAT]]

@ECHO OFF
IF '%3'=='' GOTO explain
ECHO Now checking for valid parameters . . .
ECHO %2 | FIND "%1" > XXXXXXXX.TMP
REM Only if %2 contained %1 will the tempfile be
REM non-empty. DOS won't copy an empty file. So
REM if the second tempfile exists, %2 DID contain %1.
COPY XXXXXXXX.TMP YYYYYYYY.TMP > NUL
DEL XXXXXXXX.TMP > NUL
IF EXIST YYYYYYYY.TMP GOTO BadParams
ECHO Replacing "%1" with "%2" in files matching:
ECHO %3 %4 %5 %6 %7 %8 %9
:--------------------------------------------------
ECHO Now creating DEBUG script. . .
ECHO NTEMPEDLN.SCR > TEMPDEBG.SCR
ECHO E CS:100 '1R%1' 1A '%2' 0D 0A 'E' 0D 0A 1A >> TEMPDEBG.SCR
ECHO RCX >> TEMPDEBG.SCR
ECHO 40 >> TEMPDEBG.SCR
ECHO W >> TEMPDEBG.SCR
ECHO Q >> TEMPDEBG.SCR
:--------------------------------------------------
ECHO Now creating EDLIN script . . .
DEBUG < TEMPDEBG.SCR > NUL
DEL TEMPDEBG.SCR
ECHO Replacing "%1" with "%2" in files matching: > REPL.LOG
ECHO %3 %4 %5 %6 %7 %8 %9 >> REPL.LOG
:--------------------------------------------------
ECHO Now performing replacement . . .
FOR %%f IN (%3 %4 %5 %6 %7 %8 %9) DO EDLIN %%f < tempedln.scr >> REPL.LOG
DEL TEMPEDLN.SCR
ECHO To see a log of the work REPL.BAT did, read the file REPL.LOG
GOTO end
:BadParams
DEL YYYYYYYY.TMP > NUL
ECHO Unfortunately, the string "%2" _contains_
ECHO the string "%1". REPL.BAT can't handle that.
GOTO end
:Explain
ECHO SYNTAX: "REPLACE findstr replacestr filespec [filespec...]
ECHO This batch program will search files matching up to 7
ECHO file specifications and replace all occurrences of the
ECHO "find string" with the "replace string" in each file.
:end



  3 Responses to “Category : Files from Magazines
Archive   : VOL9N19.ZIP
Filename : REPL.BAT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/