Click to See Complete Forum and Search --> : Launching an exe from ASP


micu
March 28th, 2003, 09:19 AM
Hi.

I'm trying to integrate a web application based on ASP technology with an executable application running on a client station.
Basically, I would need to be able to launch the executable application on the client starting from a web page of the Web Application (always viewed from the same client machine where the executable program resides).

Do you think this is possible?

The only solution I'm figuring out at the moment is to develop a kind of "daemon" that is always running on the client machine and that is a socket server listening to some known TCP port. Then I could develop a server component (COM ActiveX, Java servlet...) that is called from inside the client's ASP page and that could connect to the client's daemon, sending commands over the socket, according to a defined protocol. The daemon could then launch the executable application or whatever else...
The whole system would run in a protected Intranet environment, so I don't have too many security concerns...

Do you see simpler solutions?

Thanks a lot for your help.

Regards,

Marco.

V. Lorenzo
March 31st, 2003, 09:37 AM
Hi :

There is a class named Process in the namespace System.Diagnostics you may use to launch an external application. Problems may arise with it 'cause an ASP application does not have, by default, permissions to start external applications, so you may have to do some asp system account configurations work.

Here is a working example from online IDE help :

Private Sub StartWithArguments()
' Declare and instantiate a new process component.
Dim myproc As System.Diagnostics.Process
myproc = New System.Diagnostics.Process

' Do not receive an event when the process exits.
myproc.EnableRaisingEvents = False
' Start Internet Explorer, passing in a Web page.
myproc.Start("IExplore.exe", "http://www.microsoft.com")
End Sub

V. Lorz