如何通过Chrome通过HTML/javascript运行本地程序(exe) [英] How to run local program (exe) via Chrome via HTML/javascript

查看:1073
本文介绍了如何通过Chrome通过HTML/javascript运行本地程序(exe)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Chrome中建立一个(单页)本地门户网站,以打开几处内容.

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?

第二件事是我想直接在PowerPoint查看器中运行.pps文件.

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

我可以控制chrome的启动,因此可以访问本地文件.

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?

推荐答案

您可以通过在HKEY_CLASSES_ROOT中设置名称为的注册表项来设置myapp://launch/activity之类的协议来自动启动您的应用您的协议及其应采取的措施.

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.

MSDN文章显示以下警报协议注册表的示例:

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"

随后将通过请求带有alert:YOURPARAMS的url来调用,然后将调用alert.exe YOURPARAMS.

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

这篇关于如何通过Chrome通过HTML/javascript运行本地程序(exe)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆