|
|
|
#Import parent folder to import current / other packages
|
|
|
|
#########################################################
|
|
|
|
import sys
|
|
|
|
import subprocess #start process async
|
|
|
|
import os #path, run, remove
|
|
|
|
import time #timer
|
|
|
|
#lFolderPath = "\\".join(__file__.split("\\")[:-4])
|
|
|
|
lFolderPath = "/".join(__file__.split("/")[:-4])
|
|
|
|
sys.path.insert(0, lFolderPath)
|
|
|
|
#########################################################
|
|
|
|
from pyOpenRPA.Tools.RobotRDPActive import RDPConnector
|
|
|
|
mConfiguration={
|
|
|
|
"Host": "77.77.22.22", #Host address
|
|
|
|
"Port": "7777", #RDP Port
|
|
|
|
"Login": "test", # Login
|
|
|
|
"Password": "test", #Password
|
|
|
|
"Screen": {
|
|
|
|
"Resolution":"FullScreen", #"640x480" or "1680x1050" or "FullScreen". If Resolution not exists set full screen
|
|
|
|
"FlagUseAllMonitors": False, # True or False
|
|
|
|
"DepthBit":"32" #"32" or "24" or "16" or "15"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#RDPConnector.SessionConnect(mConfiguration)
|
|
|
|
#RDPConnector.LoginPassSet("111.222.222.111","ww","dd")
|
|
|
|
lRDPFile = RDPConnector.RDPConfigurationCreate(mConfiguration)
|
|
|
|
#run rdp session
|
|
|
|
lItemArgs = [lRDPFile]
|
|
|
|
subprocess.Popen(lItemArgs, shell=True)
|
|
|
|
#Remove temp file
|
|
|
|
time.sleep(2) #Delete file after some delay - one way to delete and run the RDP before because RDP is not read file in one moment
|
|
|
|
os.remove(lRDPFile) # delete the temp rdp
|