ECHO command

  • Thread starter Thread starter Inge Buller
  • Start date Start date
I

Inge Buller

Hi, I'm trying to create a VERY simple XML solution, where I create files
using ECHO. However the < and > characters makes it impossible to ECHO.

this works:

echo some text > c:\myfile.txt

this doesn´t:

echo <XML> > c:\myfile.xml

if I do:

echo "<XML>" > c:\myfile.xml

it works, but the "" end up in the file:


Any ideas?

Inge Buller
 
Inge said:
Hi, I'm trying to create a VERY simple XML solution, where I create files
using ECHO. However the < and > characters makes it impossible to ECHO.

this works:

echo some text > c:\myfile.txt

this doesn´t:

echo <XML> > c:\myfile.xml

if I do:

echo "<XML>" > c:\myfile.xml

it works, but the "" end up in the file:


Any ideas?

Use the caret (^). Ex:

echo ^<XML^>>c:\myfile.xml

Place the ^ before any pipe or redirection character if you want that
character in the output.

--
Tom Porterfield
MS-MVP MCE
http://support.telop.org

Please post all follow-ups to the newsgroup only.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top