从本地网页运行程序 [英] Run a program from a local webpage
问题描述
我试图使用网页作为信息亭的入口点。 html将在本地运行,我需要两件事:
< a href =c:\Users\ Admin \Documents> ...
这就像一个魅力
以及..
< a href =c:\程序文件\ Windows Live \Mail\wlmail.exe> ...
(程式只是一个例子,所有的程序都是一样的)
哪些工作,但..它提示下载文件,然后提示您启动它..有什么办法直接做到这一点,像点击和砰你打开notepad.exe?也许使用java applet?
谢谢
谢谢
编辑:
我知道它不能远程完成,我正在谈论本地文件。
该文件将以c:\myhtml.html
的形式访问,并且只会打开已安装的文件,而不会从网络上打开。
如果我的问题得到了解决,最接近你想要的就是使用* .hta这是一个HTML应用程序,它在浏览器窗口之外运行,就像普通的应用程序一样。
< script type =text / javascriptlanguage =javascript>
函数RunFile(){
WshShell = new ActiveXObject(WScript.Shell);
WshShell.Run(c:/windows/system32/notepad.exe,1,false);
}
< / script>
点击此处了解更多信息:
http://www.kunal-chowdhury.com/2010/09/how-to -execute-local-file-using-html.html
I'm trying to use a webpage as an entry point for a kiosk. The html will be run in local, I need two things:
<a href="c:\Users\Admin\Documents">...
Which works like a charm
And..
<a href="c:\Program Files\Windows Live\Mail\wlmail.exe">...
(program just an example, all programs are the same)
Which works but.. it prompts to download the file then you are prompted to start it.. Is there any way to do this directly, like click and bam you opened notepad.exe? Maybe using a java applet?
Thank you
Thank
EDIT:
I know it can't be done remotely, I'm talking about local files. The file will be accessed as c:\myhtml.html And will open ONLY already installed files, nothing from the web.
If i get your question right , the closest thing to get what you want would be using *.hta which is a HTML Application that runs outside the browser window just like a normal app.
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/windows/system32/notepad.exe", 1, false);
}
</script>
Bit more info here: http://www.kunal-chowdhury.com/2010/09/how-to-execute-local-file-using-html.html
这篇关于从本地网页运行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!