By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,685 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,685 IT Pros & Developers. It's quick & easy.

How to run exe from ASP.NET 2.0 page on client computer (not on the server)

P: n/a
Hello there,

I will try to be brief on this.
I have a scenario, where I need to do the following things:
1. Save server generated data to a text file on the client computer
2. Start an executable and pass the text file to it as a parameter - again
on the client computer

I managed to solve point 1 by writing a .NET class library, exposing an
Interface to it and using it in the web page similar to an ActiveX object:
<OBJECT id="MyObjectInstance" classid="MyLibrary.dll#MyNamespace.MyObject"
I had some security issues on allowing the object to write to client
computer, but I solved them by configuring the Machine Code Access Security
I am still having troubles with point 2 however.

First I tried to upgrade the library by using the System.Diagnostics.Process
class to run the exe. After experimenting with the code for a while I
realized that if a function contained some interaction with
System.Diagnostics.Process it is just not exported in the .dll (or at least
I think so).

Second I tried to use javascript to launch the exe - something like:
function RunExecutableWithParams()
var oShell=new ActiveXObject("Shell.Application");
oShell.ShellExecute("C:\\SomeExe.exe","C:\\SomeFil e.txt","","open","1");
Up to now I haven't managed to get the script to work - the page just
reports errors.
I tried tweeking Security options (particularly "Initialize and script
ActiveX controls not marked as safe"), but it didn't help.
Any kind of help will be appreciated.
Thank you in advance.
Jun 6 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.