Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: launching Winbatch from Visual Basic
I use the WaitForSingleObject, OpenProcess and CloseHandle API's which are in Kernel32.
First you get a windows handle from the Shell to WinBatch, e.g. :
iPid=Shell("c:\Winbatch\Winbatch.exe c:\winbatch\execxxx.wbt",0)Then get the NT process id by using:
iprocesshandle=OpenProcess(SYNCHRONIZE,0,iPid)then isuue a call to WaitForSingleObject(iprocesshandle,INFINITE)
VB will sit and wait until process id iprocesshandle has completed.
Finally issue a CloseHandle(iprocesshandle)
Works every time.
Article ID: W14373
Filename: Running WB from VB.txt
File Created: 1999:11:04:15:53:30
Last Updated: 1999:11:04:15:53:30