Hi Guys,
I need to run an external program from my app, and i need to wait for it to finish before continuing the processing in my app. I posted a question on this last week and i got the following code

VB Code:
  1. processID = Shell(App.Path & "\rar a " & rarName & ".rar " & "*.*", vbHide)
  2.    
  3.     If processID <> 0 Then
  4.         procHandle = OpenProcess(0, 0, processID)
  5.         If procHandle <> 0 Then
  6.             rc = WaitForSingleObject(procHandle, 100)
  7.             Do While rc <> 0
  8.                 rc = WaitForSingleObject(procHandle, 100)
  9.                 DoEvents
  10.             Loop
  11.             CloseHandle (procHandle)
  12.         End If
  13.     End If

Now, this code is supposed to get the processID of the shell command and wait for it to be released and then let me continue. This code works on my computer fine (Win XP), but when i run it on a Win2K machine, the program never leaves this loop.

Is there something wrong with this code, or is it something to do with having different numbers of apps running at the same time?

I need to get this to work on Win98+ quickly, so if anyone can see why this doesn't work, or has an alternative that does what i want then i'll be very greatful.

Thanx all in advance.