You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Sources/pyOpenRPA/Tools/RobotRDPActive/RDPConnector.py

36 lines
1.0 KiB

#Import parent folder to import current / other packages
from pyOpenRPA.Robot import UIDesktop #Lib to access RDP window
import os #os for process run
import time
#Connect to RDP session
"""
{
"Host": "", #Host address
"Port": "", #RDP Port
"Login": "", # Login
"Password": "", #Password
"Screen": {
"Resolution":"FullScreen", #"640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen
"FlagUseAllMonitors": False, # True or False
"DepthBit":"" #"32" or "24" or "16" or "15"
}
}
"""
def SessionConnect(inRDPSessionConfiguration):
#Run mstsc
from pywinauto.application import Application
lRDPApplication = Application(backend="uia").start("mstsc.exe")
lProcessId = lRDPApplication.process
#Expand the parameter section
UIDesktop.UIOSelector_Get_UIO(
[
{"process": lProcessId,"backend":"uia"},
{"title": "Пара&метры >>"}
]
).click()
#Set host:port
#Set user
#Select flag ask login/pass