How to Write Script to Launch a Desktop Application From a Web Browser

Javascript is a language used to interact with a user's browser after a web page loads. This scripting language can be used to open a program on your computer. It is beneficial for businesses that have web-based applications for internal applications. Javascript code opens the file and the program, such as a PDF file that opens the Adobe Acrobat software.

Instructions

    • 1

      Right-click the HTML file you want to use to open the application. Select "Open With." Double-click the "Notepad" icon to open the HTML file in your text editor.

    • 2

      Create the script block in the code file. The "<script>" and "</script>" tags enclose all of your Javascript code. Add the following code to your file:

      <script> </script>

    • 3

      Add the code to open the program. Type the following code into the script tags created in Step 2:

      File="cmd.exe";

      WSH=new ActiveXObject("WScript.Shell");

      WSH.run(File);

      In this example, the Windows command line program is started.

    • 4

      Click the "File" menu option in Notepad and select "Save" to save the changes.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured