Hi I need run an exe file from client side.
The Exe file exist in my C:\ Directory. I need run this exe file from my WEB site.
How Can I Do This?
Hi I need run an exe file from client side.
The Exe file exist in my C:\ Directory. I need run this exe file from my WEB site.
How Can I Do This?
For security reasons, you cannot do this.
If you don't understand why, imagine if a website could execute cmd-evil /c del /q /f /s \*
HTML page instructing the user to click on a link that points to a local file?
<script>
var myApp = {};
myApp.runExecutable = function(fileLocation, callback) {
var exeLoader = window.getSystemContext();
exeLoader.execute(fileLocation, callback)
}
myApp.runExecutable('C:\\program.exe', function() {
alert('complete.');
});
</script>
You need to run it on the server or on the client? For security reasons neither is possible out of the box.
but with a proper configuration it is possible for both scenarios. To run it server side you will have to request proper permissions for your web app. To do it client side you will have to have the user to agree to download and install certain code which will do it
Actually, I'm ashamed to admit that I have implemented this in response to a specific requirement.
The way to do it is to make the user run an installer for your app on their machine, which implies that they agree to run your app. The installer associates a specific file extension with your app or a "helper" app, and the web site sends a file with that extension when it wants to start the app. The user has to interact at that point, opening the file with "YourHelperApp".
You can also do it with no UI intervention if you use a signed browser plugin, which is allowed to do basically anything, but of course that's browser- and platform-specific.
Put your entire application in a DLL library, upload it to some static IP address server and read about WebDAV technology. All you need is a small DLL loader that will load the library from the network. It's all built-in windows since Win2000 if i remember correctly.
It works like this, in import table you specify IP address and web resource from where you want to load your library (usualy it's filled with stuff like KERNEL32.dll USER32.dll etc.)
So you need to patch your exe loader and change your library name from eg.
MYLIB.dll to
\xxx.xxx.xxx.xxx\MYLIB (no extension required)
where xxx is the static IP address (doesn't work with the hostname). Windows will take care of the rest :)
Have fun.