Is it possible to run bat/executable file using html5 button event? In IE its achievable using Shell object if I am not wrong.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
No, that would be a huge security breach. Imagine if someone could run
whenever you visted their website.
It is possible when the page itself is opened via a
file:///
path.However, the moment you put it on a webserver (even if you access it via
http://localhost/
), you will get an error:Here's what I did. I wanted a HTML page setup on our network so I wouldn't have to navigate to various folders to install or upgrade our apps. So what I did was setup a .bat file on our "shared" drive that everyone has access to, in that .bat file I had this code:
The HTML code was:
(make sure your slashes are correct, I had them the other way and it didn't work)
I preferred to launch the EXE directly but that wasn't possible, but the .bat file allowed me around that. Wish it worked in FF or Chrome, but only IE.
You can not run/execute an .exe file that is in the users local machine or through a site. The user must first download the exe file and then run the executable file.
So there is no possible way
The following code works only when the EXE is Present in the User's Machine.
<a href = "C:\folder_name\program.exe">
You can do it on Internet explorer with OCX component and on chrome browser using a chrome extension chrome document in any case need additional settings on the client system!
Important part of chrome extension source:
permission file:
and windows registry settings: