1

I created a simple batch script to format some HTML codes that i use on a regular basis. My current workaround is outputting 888 and 999 and going back into the text file and replacing all 888's with a < and all 999's with a >. I know batch uses these symbols and redirects so i wanted to know if there was a way to bypass this. Below is an example.

888div id="bestlinkstop"999
    888a href=" " target="_blank"999 888img src=" "999 888/a999
888/div999

changing all 8's and 9's to < and >

<div id="bestlinkstop">
    <a href=" " target="_blank"> <img src=" "> </a>
</div>

Thanks in advance

1
  • 1
    You will have a much more enjoyable time if switching to PowerShell. Batch (cmd.exe) parsing rules are .. terrible. Commented Jun 16, 2015 at 6:59

1 Answer 1

5

You can use the Windows escape character is ^ to escape the brackets.

Something like

echo mystring ^< div id="bestlinkstop" ^> something >>myfile.txt
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.