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?
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