I found my example:
Const INFINITE = -1&
Private Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As Long, _
ByVal dwMilliseconds As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Sub Form_Load()
'heres an example:
strBCPBatFile = "APPS\BCPTransferToMidWest.bat"
lngExecOK = Shell(strBCPBatFile, vbMinimizedNoFocus)
lProcessHandle = OpenProcess(&H100000, True, lngExecOK)
lReturnVal = WaitForSingleObject(lProcessHandle, INFINITE)
End Sub
hope this helps,
john
--- Terry.Arnett@r... wrote:
> Any ideas or examples on using the SHELL function and waiting for the
> script to complete, before returning control back to the calling VB
> program?
>
> Thanks,
> Terry
>
John Pirkey
MCSD
John@S...
http://www.stlvbug.org