最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Launch local executable from web browser - Stack Overflow

programmeradmin3浏览0评论

I am wondering if there is a way to launch on windows locally stored executable (with arguments) from web browser (not on localhost). Something equivalent to :

Process.Start("\\path\to\exe\foo.exe", arg1, arg2,..).WaitForExit()

Hopefully generic way to use in any of major browsers.

I am wondering if there is a way to launch on windows locally stored executable (with arguments) from web browser (not on localhost). Something equivalent to :

Process.Start("\\path\to\exe\foo.exe", arg1, arg2,..).WaitForExit()

Hopefully generic way to use in any of major browsers.

Share asked Aug 17, 2019 at 13:02 goryefgoryef 1,4894 gold badges25 silver badges41 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Browsers do not have this feature. Otherwise, anyone could run malicious code on users' puters. Such an opportunity is only for local instruments like Electron or Node.js, where JS process has bindings to a local file system.

As mentioned by Pavel, you cannot execute the code directly. Either you need to run something like node.js or you could have a local server like xampp installed. This will let you run PHP, which in turn would call the DOS /CLI mands to execute the local executable.

发布评论

评论列表(0)

  1. 暂无评论