How to run local program (exe) via Chrome via HTML/javascript

Alain Vanderbroeck picture Alain Vanderbroeck · May 24, 2016 · Viewed 23.9k times · Source

I am trying to build a (single page) local portal in Chrome that opens several things.

The problem is we want to run a local executable via a button on a (local) webpage. Is this possible?

The second thing is that i want to do is to run a .pps file directly in the powerpoint viewer.

I can control to the startup of chrome, so i can access local files.

All things i tried so far only made the file(s) to download, not to run.

Can somebody help me how i get this done?

Answer

MiltoxBeyond picture MiltoxBeyond · May 24, 2016

You can set a protocol like myapp://launch/activity or the like to automatically launch your app by setting up a registry key in HKEY_CLASSES_ROOT with the name of your protocol and the action it should take.

There is a MSDN article showing the following example of a registry for an alert protocol:

HKEY_CLASSES_ROOT
   alert
      (Default) = "URL:Alert Protocol"
      URL Protocol = ""
      DefaultIcon
         (Default) = "alert.exe,1"
      shell
         open
            command
               (Default) = "C:\Program Files\Alert\alert.exe" "%1"

Which would then be called by requesting a url with alert:YOURPARAMS, which would then call alert.exe YOURPARAMS.