difficulty with echoing in windows batch file

veri745

Golden Member
Oct 11, 2007
1,163
4
81
Try single quotes around the lines you're writing

*edit* what environment and shell are you using? There are some important differences between different shells.
 
Last edited:

veri745

Golden Member
Oct 11, 2007
1,163
4
81
I guess I can't read titles :)

What's the problem you're having? If it's just that the spacing is off, you can escape a space with a ^ as well

You have a lot of extra escapes, but I don't see any problems with your original:

I tried:
Code:
echo ^<?xml version="1.0"?^> > %myFile%
echo ^<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" >> %myFile%
echo  xmlns:o="urn:schemas-microsoft-com:office:office" >> %myFile%
echo  xmlns:x="urn:schemas-microsoft-com:office:excel"  >> %myFile%
echo  xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"  >> %myFile%
echo  xmlns:html="http://www.w3.org/TR/REC-html40"^>  >> %myFile%
echo  ^<Worksheet ss:Name="Sheet1"^> >> %myFile%
echo   ^<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="2" x:FullColumns="1" x:FullRows="1"^> >> %myFile%

Seems to work fine
 
Last edited: