How to ouput with ECHO into an HTML file HTML code with angle brackets without surrounding double quotes? -
i have written batch file creates html file echo command.
example:
echo "<html><body><table border="1"><tr><td> copied webfiles @ %date% %time% </td></tr></table></body></html>" >> test.html
it's working perfectly, echo command adding double quotes in html code.
how avoid double quotes in html file?
the solution leaving out double quotes lekensteyn suggested , additionally escape each angle bracket ^
explained @ escape angle brackets in windows command prompt.
echo ^<html^>^<body^>^<table border="1"^>^<tr^>^<td^> copied webfiles @ %date% %time% ^</td^>^</tr^>^</table^>^</body^>^</html^>>>test.html
there no space between ^</html^>
, >>
otherwise space written html file.
a space between >>
, file name test.html
ignored , therefore insert here space better readability if batch files edited in text editor without syntax highlighting character >
.
Comments
Post a Comment