0

I tried some code like this:

<script type="text/javascript" language="javascript">
    function RunFile() {
        var shell = new ActiveXObject("WScript.Shell");
        shell.Run("Installer/aldous/setup.exe", 1, true);
        alert("clicked");
    }
</script>

<button class="button" value="Application Installer" onclick="RunFile()">Application Installer</button>

to run my exe file but it does not work. How could I run the setup of my application through javascript?

user812786
  • 4,302
  • 5
  • 38
  • 50
  • 7
    JavaScript can't run arbitrary executables on a user's computer, if that's what you're trying to do. – user229044 Mar 03 '16 at 15:56
  • I'm 99% sure what you're attempting to do will end in tragedy, but I will counter that ONE way a person could theoretically have a webpage launch an executable is if that executable has, on the user's computer, registered itself under a "URI Scheme". This process has to start ON the target computer. This is, for instance, how Steam lets you install games while browsing the Steam website. – Katana314 Mar 03 '16 at 15:58
  • 1
    This will work only in a `.hta` file and on a local machine. – akinuri Mar 03 '16 at 15:58
  • how is that? how can i run .exe file through my webpage? – Renmart John Galang Mar 03 '16 at 16:01

0 Answers0