I tried for several days, but none can work. IE keep showing yellow exclamation mark at the status bar after clicking "Submit" and batch file cannot be executed. The HTML file and batch file is in the same folder.
Here is the code for printpage.html
Here is the code for printfile.bat
Here is the code for printpage.html
Code:
<html>
<head>
<script language="javascript" type="text/javascript">
function printFile()
{
var pg = document.getElementById("page").value;
var shell = new ActiveXObject("WScript.Shell");
shell.run( '"printfile.bat" ' + pg, 1, true );
}
</script>
</head>
<body>
<form>
<input id="page" type="file"/> <br/>
<input type="button" onclick="printFile();" value="Submit"/>
</form>
</body
</html>
Code:
@ECHO ON ECHO %1 PAUSE
Comment