I was looking for a quick and dirty way to do some simple search/replace with built in batch file commands but not a lot of code. This question popped up at the top and the answer from @Endoro is close to what I needed, but it has a few issues. One is a typo (should be %inFileName% not %FileName%), the other is that it outputs C:\=adb install C:\
for blank lines.
Below is modified version of his batch script that fixes both problems and uses environment variables for search and replace values. I did not need the removal of the .txt line so I removed that part. It haven't tested extensively, but it does suit my purposes. Maybe it will help somebody else too.
@ECHO OFF &SETLOCAL disableDelayedExpansion
SET "inFileName=infile.txt"
SET "outFileName=outfile.txt"
SET "SearchVal=C:\"
Set "ReplaceVal=adb install C:\"
(FOR /f "delims=" %%a IN ('FINDSTR /n "^" "%inFileName%"') DO (
SET "PrimLine=%%a"
SETLOCAL enableDelayedExpansion
SET "Line=!PrimLine:*:=!"
SET "Line=!Line:%SearchVal%=%ReplaceVal%!"
IF "%SearchVal%=%ReplaceVal%"=="!Line!" ECHO.
IF NOT "%SearchVal%=%ReplaceVal%"=="!Line!" ECHO(!Line!
ENDLOCAL
))>"%outFileName%"