Go back to the os.startfile version: there doesn't seem to be a very simple solution to all this -- the Pageant executable must remain active for the keys to work, so if we use any technique to "wait" for it, the process will never continue. We probably need to work out some kind of semaphore so we can poll to check whether the key has been initiated, say attempting a connection and trapping the failure.