I want to execute a batch file on a button click event from simple HTML page.
In IE, I can use ActiveXObject
to achieve this however in other browser ActiveXObject
is not supported.
Sample HTML File:
<html>
<head>
<title>Run Batch</title>
<HTA:APPLICATION
APPLICATIONNAME="Run Batch"
ID="MyHTMLapplication"
VERSION="1.0"/>
</head>
<script type="text/javascript">
function RunBat(){
var shell = new ActiveXObject("WScript.Shell");
var path = "D:/Test.bat";
shell.run(path);
}
</script>
</head>
<form>
Execute:
<input type="button" Value="Run" onClick="RunBat();"/>
</form>
</html>
I have gone through many questions on different forums and what I have found is that, in other browsers it is possible through some add-ons.
Is there any other way to execute it without using any add-ons in other browser?
If no, what are the add-ons I can use for Firefox, Chrome and Edge browsers to achieve this?