2

beginner at HTML/js here

I'm making a local .html file not linked to any server that I can open from my favorites inside my browser and maybe click a button to open a .exe on my computer, I thought it would be a silly 10 minutes idea. I have now looked at so many StackOverflow questions and read so much HTML and js source code that I want to cry.

I really just want to do something like zoom does when you open a meeting

[I know it's opening a link but I could maybe throw that to a python script]

like this

like this, but with my own executable.

I have tried a herf, a button, wshShell.Run(), "file:filename", Shell, bat, punching my table, etc...

those either didn't work, tried to make me download the file or made my hands hurt

my code looks something like this:

<!DOCTYPE html>
  <script type="text/javascript" language="javascript">
    function PainFunc() {
      runing the file somehow
    }
  </script>
  <html>
    <head>
      <title>"AAAAAAAAAPAIN"</title>
    </head>
    <body>
      <button type="button", onClick=:"PainFunc()">AAAAAAAAAAA</button>
    </body>
   </html>

pls help

guiloj
  • 35
  • 1
  • 5

1 Answers1

3

How to run an .exe from a .html button

You can't. At least, not directly.

However, you can register a protocol handler:

web+yourapp://do-some-thing

When invoked, your executable will launch and be passed this URL, which you can then parse and decide how to handle.

How you register the protocol handler is dependent on what OS you're using. See also: How to register a url protocol handler in Node.js

Brad
  • 159,648
  • 54
  • 349
  • 530