Sounds like you should stop using System to launch the program, and use CreateProcess instead, and possibly WaitForInputIdle, not to mention CloseHandle.