Here are two proecdures I used in VB6 to shell out a command, and wait for it to be terminated. Note that DoEvents was used to free the cpu to other processes. I desperately need to port these to a web based ASP.NET solution, and am unable to work out how this could possibly work in an asmx page. Any help greatly appreciated.
If at all possible I need to have the process that is created interacting with the desktop. I have also had trouble getting new processes to do this.
Sub ExecCmd(ByVal vstrCommand As String, Optional ByVal vlngWindowStyle As VbAppWinStyle = vbMinimizedNoFocus) '=vbHide
WaitForTermination Shell(vstrCommand, vlngWindowStyle)
Private Sub WaitForTermination(ByVal vlngProcessId As Long)
Dim pHnd As Long
pHnd = OpenProcess(SYNCHRONIZE, 0&, vlngProcessId)
If pHnd <> 0& Then
Do Until WaitForSingleObject(pHnd, 1&) = 0&