Try using a semaphore on Windows for command syncronisation.