Forum Moderators: open

Message Too Old, No Replies

Opening an *.exe from *.html

Without the dialogue box appearing

         

Alternative Future

1:03 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

I have a link to (for example) WordPad in my html document, when I click on this link I get the MS dialogue box appearing with the options 'Open' 'Save' 'Cancel' 'More Info'.
Is there a way so that I can open the application automatically without this dialogue box appearing as the application has already been installed on the PC (and all users PC's)
Currently the anchor tag looks like this :<a href="file:C:\Program Files\Windows NT\Accessories\wordpad.exe">Open WordPad</a>

Any help on the matter is appreciated...

Thanks in advance,

-gs

JasonD

1:37 pm on Jan 8, 2004 (gmt 0)

10+ Year Member



There are a few ways to get this to work though almost all of them emulate virus techniques to manipulate the browser in ways it should not allow.

The reason for this is that it is extremely dangerous for the user to directly execute a file on their computer from an untrusted zone. I.E. The internet.

If you are trying to do this for your public website then I suggest you think again.

If though, you are trying to do this for a company Intranet or local LAN then stickymail me with your goals and reasons for wanting to do this and I "may" help you.

Jason

Alternative Future

1:43 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Jason,

Many thanks for your prompt response.

I have managed to do it with the use of JavaScript using the ActiveX control as follows:

function executeWinWord(){
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe";
oShell.ShellExecute(commandtoRun);
}

And yeah it for use in the company Intranet.

Once again thanks,

-gs