Open an exe file through a link in a HTML file - Javascript Language Basics

Javascript examples for Language Basics:ActiveXObject

Description

Open an exe file through a link in a HTML file

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Open exe</title> 
      <script type="text/javascript">
        function runProgram()/*from  ww w  . j  ava2s.  c o m*/
        {
            var shell = new ActiveXObject("WScript.Shell");
            var appITunes = "\"C:\\Program Files\\iTunes\\iTunes.exe\" ";
            shell.Run(appITunes);
        }
        
      </script> 
   </head> 
   <body> 
      <a href="javascript:runProgram()">Run program</a>  
   </body>
</html>

Related Tutorials