• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

difficulty with echoing in windows batch file

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:
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:
Back
Top