I have this bat file that i execute and it works great:
SET RPPROPERTIESPATH='C:\work\filepath.txt' //contains the word 'string1'
powershell -Command "(gc %RPPROPERTIESPATH%) -replace 'string1', 'string2' | Out-File -encoding ASCII %RPPROPERTIESPATH%"
But i want the replace param to come from a variable like so:
SET RPPROPERTIESPATH='C:\work\filepath.txt' //contains the word 'string1'
SET STRINGTOREPLACE='string3'
powershell -Command "(gc %RPPROPERTIESPATH%) -replace 'string1', %STRINGTOREPLACE% | Out-File -encoding ASCII %RPPROPERTIESPATH%"
This is not working, how should i make this work?