View Full Version : Launch Program from Inside Web
gbrown
05-28-2008, 11:57 AM
Well, gosh, it's been a while since I've been over here asking questions...
Simple one:
Is there a way to launch a LOCAL program from inside a web page? What I want is a button that sends folks to execute a vanilla EXE on their machine.
Thanks much...
GcB
rexzooly
05-28-2008, 05:55 PM
Well, gosh, it's been a while since I've been over here asking questions...
Simple one:
Is there a way to launch a LOCAL program from inside a web page? What I want is a button that sends folks to execute a vanilla EXE on their machine.
Thanks much...
GcB
if there in there same local place on every system then its possable and i also think its possable with some commands if its called via AMS web browser but
i am not sure.:yes
RizlaUK
05-28-2008, 06:11 PM
use the web objects "On Navigate" event to detect the link with "e_URL",
eg:, give your link a unique target name, something like "http://##RUNAPP##" and in the web objects "On Navigate" event put something like this.
if e_URL == "http://##RUNAPP##" then
-- file.run(bla,bla,bla)
end
its not tested but something like that should work :yes
yosik
05-30-2008, 08:06 AM
If you want to do that without the use of AMS, you can do the following:
Insert the code bellow in the <body> of your HTML file.
<SCRIPT Language="JScript">
function runcmd() {
File="cmd.exe";
WSH=new ActiveXObject("WScript.Shell");
WSH.run(File);
}
</SCRIPT>
<A href="#" onClick="runcmd(); return false;">Run CMD.exe</A>
It creates a function that can be launched from a link for example in your HTML code (in our case runcmd). This will run the File variable that must be set - i used cmd.exe in my example. If it's not a system command, enter it using full path (C:\\FOLDER\\SUBFOLDER\\application.exe for example).
If you want to launch the application on page load, use the <body> tag like this:
<body onLoad="javascript:runcmd();">
Note that due to security riscks, usually a confirmation dialog will appear before running the application requested.
The script works well on Internet Explorer. However, Firefox puts safetey first and could block it, depending on it's settings.
(taken from: http://www.tutorial5.com/content/view/51/45/)
Good luck
Yossi
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.