launch not download

kane88

New Member
in one of my webpage i have a link to a software stored in my server , but whenever i click on the link it downloads the file rather than executing it .

so how can i modify so that the .exe file launches rather than download.
 

jnjc

New Member
Different browsers are going to do different things here, you best bet is to test it on the various browsers and hace an instructions page...
 

conor

New Member
my initial reaction is to do the same thing as you do for downloads, use php! After a bit of googleing I found this:

http://ie2.php.net/exec

Code:
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run("notepad.exe", 7, false);
 

jnjc

New Member
Code:
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run("notepad.exe", 7, false);

This command is to run the code server side, not when the user clicks.

When the user clicks a link there is no php code being executed on the users machine (most won't have it installed), therefore the above will not do what he wants.

Most browsers are pretty edgy about executing .exe code from a page, it'd be such any easy way to spread viruses etc.

Each browser will display a slightly different message when you click a .exe, but personally I wouldn't use a browser that just ran code without telling me.

Look at sites like Microsoft etc. they all include instructions when you have to download an executable.
 
Top