2

I was wondering if it is possible to use the "<" and ">" when writing to a HTML file from a batch file. I need this so I can write certain things to html files. I tried the following and it didn't work:

 ECHO </html> >>File.html

PS. Thanks in advance

2 Answers 2

1

It's a little messy, but you have to escape the < and > characters using ^:

echo ^<html^> >> a.html

echo ^<body^>Hi^</body^> >> a.html

echo ^</html^> >> a.html

Result:

<html> 
<body>Hi</body> 
</html> 
Sign up to request clarification or add additional context in comments.

Comments

1

You can escape the character by placing a carot sign (^) in front of "<" and ">".

echo ^</html^> >>File.html

1 Comment

It is "caret", not "carot"... ;-)

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.