1

I was trying to launch a putty.exe file through HTML locally only. I have made an HTML page which has list of environments and when you click on a particular environment it opens up the session in putty. I was able to achieve this through an ActiveX object, but it works only in IE. I am trying to make it cross- browser compatible so that it can run on either Chrome or Firefox also. My HTML page looks like this :

<html>
<head>
    <script>
        function LaunchApp(envName) {
            var env = envName
            var oshell = new ActiveXObject("WScript.Shell");
            var commandtoRun = "C:\\putty.exe "+env;
            oshell.Exec(commandtoRun);
        }
    </script>
</head>
<body>
    <h1>Run a Program</h1> 
    This script launch the file any Exe File<p> 
    <!--
        <button onclick="LaunchApp('gsamqaauth.sapient.com')">Run Exe File</button>  
    -->
    <a href="#" onclick="LaunchApp('enviornment')">environment</a>
</body>
</html>
Arend
  • 3,741
  • 2
  • 27
  • 37
rishabh aggarwal
  • 129
  • 1
  • 3
  • 9
  • [Edit] Changed the title to fit the question, not the method suggested. – Arend May 04 '15 at 07:18
  • I'm pretty sure this has been disabled in most newer browsers for security reasons. This will never happen or be enabled by web browser engineer's. And what IE did you run it under IE 7? lol – NiCk Newman May 04 '15 at 07:20

1 Answers1

0

On Windows, you can use custom URL protocols to launch executables from browsers. This is supported by Chrome and Firefox as well as Internet Explorer.

Anderson Green
  • 30,230
  • 67
  • 195
  • 328