public API_GuiAutomation launchRdpClient(string ipAddress, string username, string password) { var terminalServicesClient = Processes.startProcess("mstsc.exe"); var guiAutomation = new API_GuiAutomation(terminalServicesClient); var window = guiAutomation.window("Remote Desktop Connection"); window.textBox("Computer:").set_Text(ipAddress); if (username.valid()) { window.button("Options ").click(); this.sleep(1000); window.textBox("User name:").set_Text(username); } window.button("Connect").mouse().click(); var loginWindow = guiAutomation.window("Windows Security", 3); if (password.valid()) { guiAutomation.keyboard_sendText(password); } loginWindow.button("OK").click(); return(guiAutomation); }