# Replace here-string in file

This topic contains 2 replies, has 2 voices, and was last updated by  Seni 6 months, 1 week ago.

• Author
Posts
• #84050

Seni
Participant

I have the following string in a batch file:

@Echo Off

rem Comment

If Exist "C:\Windows\installer\21dc3e5.msi" Call msiexec.exe "C:\Windows\installer\21dc3e5.msi"

I want to replace this entire block at once because my batch files contains similar lines.
I tried here-strings but after I escape the backslash with \\ the resulting string won't match the one that is in the file.

Thank you

• #84053

Alex Aymonier
Participant
• #84097

Seni
Participant

Solved. Thanks!

You must be logged in to reply to this topic.