Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
279 views
in Technique[技术] by (71.8m points)

html - Run a program from a local webpage

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:UsersAdminDocuments">...

Which works like a charm

And..

<a href="c:Program FilesWindows LiveMailwlmail.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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...