Replace here-string in file

Welcome Forums General PowerShell Q&A Replace here-string in file

This topic contains 2 replies, has 2 voices, and was last updated by

1 year, 3 months ago.

  • Author
  • #84050

    Points: 0
    Rank: Member

    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

    Points: 101
    Helping Hand
    Rank: Participant
  • #84097

    Points: 0
    Rank: Member

    Solved. Thanks!

The topic ‘Replace here-string in file’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort