Löste det faktiskt själv som jag sade efter lite googlande. Här är kode ja använde mig av:
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private pid As Long
Private Const SYNCHRONIZE = &H100000
Private Const INFINITE = -1&
Private Sub Command1_Click()
pid = Shell("D:\skolan\vbleet\add.bat", vbHide)
Print pid
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim process_handle As Long
process_handle = OpenProcess(SYNCHRONIZE, 0, pid)
If process_handle <> 0 Then
WaitForSingleObject process_handle, INFINITE
CloseHandle process_handle
MsgBox "klart"
End If
End Sub
Kom på att ja inte ens behövde timern, men saken med detta är ju att programmet "hänger sig" medans det väntar...Kan jag inte bara i timern på ngt sätt kolla varje sekund om det körs eller inte utan att köra WaitForSingelObject()...
Eller ngt annat tips tack.