midiboy Posted January 11, 2009 Posted January 11, 2009 Hi guys,once again, a problem with cmd commands :-) If anyone has a solution, I would very much appreciate it ...Here´s the problem:I need to dynamically create an xml file with a commandline script so I was thinking of using the ECHO command to create that script something like:ECHO This text goes to the new file >C:\Test.xmlECHO Next line >>C:\Test.xmlOnly problem is ... the xml file has symbols in the text that ECHO interprets as commands. Example: this line should go into the xml:<?xml version="1.0" encoding="utf-8"?>Now, how do I do that ? Iif I wrap the whole code into double quotes like this:ECHO "<?xml version="1.0" encoding="utf-8"?>" >C:\Test.xmlthe quotes get written into the xml like this:"<?xml version="1.0" encoding="utf-8"?>"If I don´t do that, ECHO interprets the "<" and ">" symbols as commands and throws an error message.If I use single quotes instead of double quotes, the whole code gets messed up even more. I also tried adding a "\" before the double quotes but this does not help either.Since the whole thing is part of a bigger cmd script, it should not be vbscript or anything else.Does anyone have an idea ??Thanks for your help! Alex
midiboy Posted January 11, 2009 Author Posted January 11, 2009 Hi again,ah, I should have looked up Technet before posting here, sorry The solution is to add a "^" before each ">" or "<". Bye,Alex
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now