I am a javascript novice trying to execute a bat file from a web page using 'WScript.Shell'. When I test it I get an error saying cant locate file. the code is pasted below please help. Alternative suggestions are welcome
<html>
<head>
<title> *** Bat File Runner *** </title>
<script type="text/javascript">
<!--
function MyFunction()
{
var Shell = new ActiveXObject("WScript.Shell");
var ret = Shell.run("C:\Folder\test.bat")
Shell = null;
}
//-->
</script>
</head>
<body>
<form>
<input type="button"
onclick="MyFunction()"
value="Run Function">
</form>
<p>Press button to run Function.</p>
</body>
</html>
<html>
<head>
<title> *** Bat File Runner *** </title>
<script type="text/javascript">
<!--
function MyFunction()
{
var Shell = new ActiveXObject("WScript.Shell");
var ret = Shell.run("C:\Folder\test.bat")
Shell = null;
}
//-->
</script>
</head>
<body>
<form>
<input type="button"
onclick="MyFunction()"
value="Run Function">
</form>
<p>Press button to run Function.</p>
</body>
</html>