I am trying to automate typing Win + R, and entering mstsc. This should open a Remote Desktop Protocol (RDP) window. In the RDP window, I have to enter a host name. All these should be done using UI path.

How can I achieve this?

1 Answer 1


You have the option to connect using a set of commands

But if you want to use the UI for this or other Windows related apps, you can try pywinauto. Here is an example from the pywinauto docs:

from pywinauto.application import Application
# Run a target application
app = Application().start("notepad.exe")
# Select a menu item
app.UntitledNotepad.menu_select("Help->About Notepad")
# Click on a button
# Type a text string
app.UntitledNotepad.Edit.type_keys("pywinauto Works!", with_spaces = True)
  • 1
    I think the main issue here is how to access controls within RDP screen.
    – Alexey R.
    Commented Dec 21, 2018 at 11:44
  • @AlexeyR. yes. I am trying to use explore how to use UI path to automate a particular scenario which requires me to take a remote desktop connection.
    – shruthi
    Commented Dec 22, 2018 at 14:03
  • Remote Execution Guide Commented Dec 25, 2018 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.