So I'm trying to execute a .bat file from a JS code:
My HTML code includes:
<body dir=rtl onload="runExe()">
as my main.js JavaScript code is:
function runExe(){
var shell = new ActiveXObject("WScript.Shell");
var path = 'write.bat';
shell.run(path,1,false);
}
The write.bat
file adds a "success" word to a .txt file.
So far this code has no output to the text file. with a simple alert('x')
command I realized that the code stops at the second line of JS code. Any ideas why? Is there something wrong with the ActiveXObject code?