(view source code of far.bat as plain text)
@ECHO OFF
IF [%3]==[] GOTO Syntax
VER | FIND "Windows NT" >NUL
IF NOT ERRORLEVEL 1 GOTO NT
VER | FIND "Windows 2000" >NUL
IF NOT ERRORLEVEL 1 GOTO NT
%0.\
CD %0.\..
IF NOT EXIST far.kix GOTO Syntax
KIX32 FAR.KIX $S=%1 $R=%2 $STRING=%3
FOR %%A IN (CALL DEL) DO %%A %TEMP%.\_FAR_.BAT
GOTO End
:NT
IF NOT EXIST %~dpn0.kix GOTO Syntax
KIX32 %~dpn0.kix $S=%1 $R=%2 $STRING=%3
FOR %%A IN (CALL DEL) DO %%A %TEMP%.\_FAR_.BAT
GOTO End
:Syntax
ECHO FAR.BAT -- Find And Replace, Version 1.00
ECHO Search a string for a substring and replace it with another substring
ECHO.
ECHO FAR.BAT uses a Kix script named FAR.KIX which should be located in the
ECHO same directory. Make sure KIX32.EXE can be found in the PATH.
ECHO FAR.KIX creates a temporary batch file _FAR_.BAT in the TEMP directory.
ECHO FAR.BAT uses the temporary batch file to store the modified string into
ECHO an environment variable NEWSTRING.
ECHO.
ECHO Usage: FAR "string1" "string2" "string0"
ECHO Where: string0 = the string to be searched
ECHO string1 = the substring to search for
ECHO string2 = the substring that should replace string1
ECHO All strings must be enclosed in double quotes.
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
:End
page last modified: 2024-04-16; loaded in 0.0045 seconds