JS開啟PC端本地exe應用程式方法

2021-10-22 08:42:34 字數 802 閱讀 1571

1.記事本(或其他文字編輯器)建立protocal.reg檔案

windows registry editor version 5.00

[hkey_classes_root\webshell]

@="url:webshell protocol handler"

"url protocol"=""

[hkey_classes_root\webshell\defaulticon]

[hkey_classes_root\webshell\shell]

[hkey_classes_root\webshell\shell\open]

[hkey_classes_root\webshell\shell\open\command]

2.開啟檔案後修改內容參考下圖

2.1修改可執行檔案路徑

示例為谷歌瀏覽器

3.執行protocal.reg檔案,新增到登錄檔

4.建立html使用方法如下

node開啟本地應用程式

最簡單的方法 const cp require child process cp.exec start 自動開啟預設瀏覽器 另一種方法是安裝open 依賴包 const open require open async opens the url in the default browser.awai...

js呼叫本地應用程式

2.npapi 外掛程式 window下開發npapi參考文件 npapi 是重型 當別的方法無法到達你的目的時,才建議使用。執行在npapi外掛程式中的 擁有當前使用者的全部許可權,不能利用google chrome 的沙箱技術和其他安全防護技術。在處理不可信任的輸入,如content scrip...

AIR程式呼叫本地預設應用程式開啟本地檔案

air程式呼叫本地預設應用程式開啟本地檔案 當我用下面語句的時候,可以成功開啟桌面資料夾下面的檔案 當我這樣呼叫的時候,報錯了 error error 3000 illegal path name.at error throwerror 網上搜了一下,發現要在xml檔案下面寫一句配置 extende...