Using Process in ASP.NET

VBAHole22

Contributor
Joined
Oct 21, 2003
Messages
432
Location
VA
I have a win app working that uses Process and ProcessStartInfo to fire off a program from the dos command prompt. It works great but now I need to get it to work from an ASP.NET web page or from an ASP.NET web service and I cannot get either to work.
It looks like the process is executed but the results are not there.

I tried impersonating in case it was a permissions issue and it didn't help.

The only thing I can think of is that the process object is somehow crippled in asp.net for security reasons or something. But shouldn't I be able to get around this?

Code:
Function aProcess(ByVal Arg As String) As String
        Dim ps As New ProcessStartInfo
        Dim p As New Process

        Try
            ps.FileName = "cmd.exe"
            ps.Arguments = Arg
            ps.UseShellExecute = True
            p.StartInfo = ps
            p.Start()
            p.Close()

            Return "Success"
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function
 
Even with impersonate on?
I thought it would run under the impersonated account? Is it not doing that because it is on another thread or something?

I have tried asp.net web services, and straight asp.net and no luck.
Now I am on to Windows service.

Does anyone know how to call a windows service and pass in parameters?

If I google for '.net windows service' I get the same tired sample on 6 different websites, that stinks. :(
 
1. change your Win App to a ServicedObject,
2. load it in COM services
3. give ASPNET permission to launch it
4. Rewrite your win app to call the serviced object*
5. Done


* this is optional, but it allows for a single functional unit used by your asp as well as your win.
 
Back
Top