Thanks to your answer.
I find the Shell command not suited in my case. The Shell function runs other programs asynchronously, meaning I can risk having the next Vb
statement executed before the Shell function is finished executing, as I understand. In my case I am starting a long running .cmd file with CreateProcessA. This lets me wait with the WaitForSingleObject until the shelled application is finished.
In .cmd files you can test for errorlevel. This is what I would like to pass back to VB
together with a message text depending on where in the file errorlevel was raised.