Why can't I do this from ASP.NET?
Posted
by Nissan Fan
on Stack Overflow
See other posts from Stack Overflow
or by Nissan Fan
Published on 2010-05-01T18:25:21Z
Indexed on
2010/05/01
18:27 UTC
Read the original article
Hit count: 198
The code below spawns the process and sits forever, never finishing. It doesn't matter what process I run. Also, if I use Shell with Wait it does the same thing. If I set wait to false in either approach it works just fine. It's ASP.NET 2.0 VB.NET DotNetNuke 4.0 on Windows Server 2003. I can't even phathom why this would hang up.
From: http://www.freevbcode.com/ShowCode.asp?ID=5879
Public Sub ShellandWait(ByVal ProcessPath As String)
Dim objProcess As System.Diagnostics.Process
objProcess = New System.Diagnostics.Process()
objProcess.StartInfo.FileName = ProcessPath
objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
objProcess.Start()
'Wait until the process passes back an exit code
objProcess.WaitForExit()
'Free resources associated with this process
objProcess.Close()
End Sub
© Stack Overflow or respective owner