View Single Post
Old 23rd July 2015, 22:39   #1
pkonduru
Member
 
Join Date: Jul 2015
Posts: 62
Find and replace text in multiple files in a directory

Hi Guys,

I have been trying to replace text in multiple files in a directory but have not been successful. Here is my code. My code only replaces the first file and does not do the replace on the remaining files.

FindFirst $0 $1 "$INSTDIR\tools\*.bat"
FileLoop:

StrCmp $1 "" DoneFileLoop ;Check for no files
DetailPrint $1 ;Print file name

${textreplace::ReplaceInFile} "$INSTDIR\tools\$1" "$INSTDIR\tools\$1" "\jre" "\..\jre" "/S=1 /C=1 /AO=1" $0

FindNext $0 $1 ;Get the next file from the list

goto FileLoop ;Go back to the top and check for no files
DoneFileLoop:
pkonduru is offline   Reply With Quote