Claro que existe.
Acordate que cualquier *.bat ejecuta desde una consola de DOS
.
Por Ejemplo en WinXP el batch ejecuta junto el el cmd.Uso Pausa porque el sleep es horrendo, con pausa puedo seguir tranquilamente con otras funciones sin problemas, hace una pausa a la siguiente linea pero solo dentro de la funcion.
'PROCESOS
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
'PAUSA
Private Declare Function GetTickCount Lib "Kernel32.dll" () As Long
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400
'FUNCION DE SLEEP PARA ESPERAR UNOS MILISEGUNDOS
Sub Pausa(HowLong As Long)
Dim u%, tick As Long
tick = GetTickCount()
Do
u% = DoEvents
Loop Until tick + HowLong < GetTickCount
End Sub
Y aca la funcion en concreto:
Function ExeEspera(COMANDO as String)
Dim hProcess As Long
Dim RetVal As Long
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(COMANDO, vbMinimizedNoFocus))
Do
GetExitCodeProcess hProcess, RetVal
DoEvents
Pausa 100
Loop While RetVal = STILL_ACTIVE
End Function