Running programs means they will spawn off new processes. This can get really messy when you need to continue processing a script after the program completes. The solution to your problem is to use the shell command instead. Shell will wait for the execution to complete before returning control to your script. Example:


Shell "%comspec% /e:1024 /c patch.exe"
; no sleep command needed
; more commands