Recently I was trying to get a quick alert box from javascript using mshta but I noticed something strange and I have no ideea what the problem is. This is,in a way,what I was trying to achieve:
mshta javascript:alert("The file was stored here:\"C:\\folder_with_space_ _.txt");
The error it gives is the one in the title of this post(char 57).I tried a combination of things and:
//code that works:
mshta javascript:alert("The file was stored here:\"sdadasd");
mshta javascript:alert("The file was stored here:\"\" sdadasd");
//error-notice the space;error on char 35
mshta javascript:alert("The file was stored here:\" sdasds");
It looks like it's giving error when the number of double-quotes is odd,but:
//error
mshta javascript:alert("The file was stored here:\" \"sdadasd");
I tried to do the same in a browser console and it worked. I believe is some kind of parser-error.How can I fix it?(I am thinking of using fromCharCode to directly insert the double quote).
Note: the commands were run from cmd.