WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Launching WinBatch and Other Apps
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Running WB from VB

Keywords:   launching Winbatch from Visual Basic

I use one methods that always seems to work.

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