Public Sub ShellAndWait(cmdLine As String)
Dim hProcess As Long Dim taskId As Long taskId = Shell(cmdLine, vbNormalFocus) hProcess = OpenProcess(SYNCHRONIZE, True, taskId) Call WaitForSingleObject(hProcess, WAIT_INFINITE) CloseHandle hProcess End Sub |