Monday, August 4, 2014

Open local file(any type of file) using Internet Explorar.

I am going to share a code to open any type of desktop application using Internet Explorar (IE) .

If you run this code inside the browser, it will not work. To resolve this, just save the file with a .hta extension. You will see that the file icon has changed to an application icon. If you double click on this file, it will execute and open a Window having the button inside it. Click the button to open the notepad.exe file.

    <title>Application Executer</title>
   APPLICATIONNAME="Application Executer"
    <script type="text/javascript" language="javascript">
        function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/windows/system32/notepad.exe", 1, false);
<input type="button" value="Run Notepad" onclick="RunFile();"/>

No comments:

Post a Comment