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?
How to run a.exe from chrome browser using javascript? Short answer: you can't. It is for security reasons. Just imagine, you visit a random website and it launch any EXE it wants on your PC.
You can't run an exe file on a html. (First, if it's a Linux server, exe files won't run on it and second, if you're on a Windows server, your host would kill the program immediately. And probably terminate your account.) Can somebody explain .bat files and .exe files to me in detail?
The security risks of giving scripts within a browser access to the underlying OS are great and are either extremely limited or not allowed at all. Writing a Chrome extension could allow more than would be possible with JavaScript alone, but even then I don’t think opening and running OS exe files is something that is possible.
How can I make a button in HTML that launches an already downloaded .exe file? It May be possible but likely to be discouraged and deprecated as a security risk. What if you made this button and then programmatically clicked it? Then you would be able to run any program by having someone visit a webpage.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With