From bc56245394554f3e60604079c77c9f2f6a43b710 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Thu, 12 Mar 2020 17:24:59 +0300 Subject: [PATCH] # RobotRDPActive - turn on shared drive for file transmition --- .../Tools/RobotRDPActive/Connector.py | 5 +++++ .../Tools/RobotRDPActive/Template.rdp | Bin 2392 -> 2426 bytes .../SettingsRobotRDPActiveExample.py | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/pyOpenRPA/Tools/RobotRDPActive/Connector.py b/Sources/pyOpenRPA/Tools/RobotRDPActive/Connector.py index 45abf837..72e37915 100644 --- a/Sources/pyOpenRPA/Tools/RobotRDPActive/Connector.py +++ b/Sources/pyOpenRPA/Tools/RobotRDPActive/Connector.py @@ -61,12 +61,17 @@ def SessionConfigurationCreate(inConfiguration): if 'Port' in inConfiguration: if inConfiguration['Port']: lHostPort=f"{lHostPort}:{inConfiguration['Port']}" + # Generate parameter for .rdp "drivestoredirect:s:C:\;" + lDriveStoreDirectStr = "" + for lItem in inConfiguration['SharedDriveList']: + lDriveStoreDirectStr+=f"{lItem.upper()}:\\;" # Attention - all drives must be only in upper case!!! #Replace {Width}, {Height}, {BitDepth}, {HostPort}, {Login} lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Width}", str(inConfiguration.get('Screen',{}).get("Width",1680))) lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Height}", str(inConfiguration.get('Screen',{}).get("Height",1050))) lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{BitDepth}", inConfiguration.get('Screen',{}).get("DepthBit","32")) lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{HostPort}", lHostPort) lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Login}", inConfiguration['Login']) + lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{SharedDriveList}", lDriveStoreDirectStr) #Save template to temp file lRDPCurrentFileFullPath = os.path.join(tempfile.gettempdir(), f"{uuid.uuid4().hex}.rdp") open(lRDPCurrentFileFullPath, "w", encoding="utf-16-le").write(lRDPTemplateFileContent) diff --git a/Sources/pyOpenRPA/Tools/RobotRDPActive/Template.rdp b/Sources/pyOpenRPA/Tools/RobotRDPActive/Template.rdp index 10193862dfea58a6012d7f1eec1e9b6ee018e938..aeeb6d1ba600945c54a0e897f3bd4a5d3bae368d 100644 GIT binary patch delta 45 wcmca1^h;<152s=^Loh=ILn1>FLn=cGgA0((WGDl&eSmZ^LkUCeWNuDh01N~Qwg3PC delta 11 Scmew*bVFzZ59ee(P9Fdq9s|+< diff --git a/Utils/RobotRDPActive/SettingsRobotRDPActiveExample.py b/Utils/RobotRDPActive/SettingsRobotRDPActiveExample.py index 3df138e7..94c7e5be 100644 --- a/Utils/RobotRDPActive/SettingsRobotRDPActiveExample.py +++ b/Utils/RobotRDPActive/SettingsRobotRDPActiveExample.py @@ -11,7 +11,7 @@ lOrchestratorProtocol="http" lOrchestratorAuthToken="1992-04-03-0643-ru-b4ff-openrpa52zzz" lRobotRDPActiveFolderPath = '\\'.join(RobotRDPActive.__file__.split('\\')[:-1]) -print(f"{os.path.join(lRobotRDPActiveFolderPath,'SessionDefs.py')}") +#print(f"{os.path.join(lRobotRDPActiveFolderPath,'SessionDefs.py')}") def Settings(): mDict = { "RDPList": @@ -28,6 +28,7 @@ def Settings(): "FlagUseAllMonitors": False, # True or False "DepthBit": "32" # "32" or "24" or "16" or "15" }, + "SharedDriveList":["c"], # List of the Root sesion hard drives "SessionHex":"", # Hex is created when robot runs "FlagSessionIsActive": False }