Chip Thrasher Chip Thrasher - 3 months ago 30
HTML Question

How to Open a Windows Program with JavaScript?

So I'm trying to make a projects hub for Windows (run locally with Localhost) that will open different apps (e.g. a CAD program) at the click of a button. Is this insecure? If not, how would I do it? If so, is there an alternative? Thanks!


A URI (Uniform Resource Identifier) will provide for the best user experience. A URI is a schema that can launch an application as well as pass data into the application. The most common example of a URI is the mailto: for launching a computer's mail client from a website.

Creating a URI involves editing the registry. Here is some Microsoft Documentation on how to do it. Looking at other examples in the registry like mailto:

Lastly, I have seen people use <a href="path.lnk"> to shortcut links that works ok in Internet Explorer. You will still get a prompt to open or save; however, its the simplest solution.