Search the Community
Showing results for tags 'rdp file copy'.
-
Hello from Barcelona. I'm working in a script that fills some pdf files with some strings of text. The main problem that I have is that the last and updated version of these files is in the server of our company. As some old files might get an update, I do always need to get the latest version of the files (just one single pdf for every time that the script is executed. I've been reading and surfing int he forum for examples for this kind of remote file copying, but none of them has worked for me. I know that I can acces to the server because thanks to one of those examples I can connect in a RDP conecction. The RDP connection script is this one: #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <AutoItConstants.au3> $oRDP = ObjCreate("MsTscAx.MsTscAx") $gui = GUICreate("RDP", 800, 800, 0, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUISetState(@SW_HIDE, $gui) $GUIActiveX = GUICtrlCreateObj($oRDP, 0, 0, 800, 800) GUICtrlSetStyle($GUIActiveX, $WS_VISIBLE) GUICtrlSetResizing($GUIActiveX, $GUI_DOCKAUTO) GUISetState() $oRDP.Server = "192.168.20.61" ;NetBIOS, DNS oder IP des Gerätes $oRDP.Domain = "FILESERVER" ;Anmeldedomäne (Rechnername oder NetBIOS Domänenname) $oRDP.UserName = "companyname1\user" ; Benutzername $oRDP.AdvancedSettings2.ClearTextPassword = "XXXXX-XXXXX-XXXXX" ; das Passwort dazu $oRDP.FullScreen = False ; Vollbild ja/nein - hat nichts mit der Auflösung zu tun $oRDP.AdvancedSettings2.RedirectDrives = True ; Sollen die Laufwerke mitgenommen werden $oRDP.AdvancedSettings2.RedirectPrinters = False ; Sollen die Drucker mitgenommen werden $oRDP.AdvancedSettings2.RedirectPorts = False ; Ports wie LPT1 etc $oRDP.AdvancedSettings2.RedirectSmartCards = False ; SmartCards für Authentifizierung $oRDP.ConnectingText = "Conectando ...." ; Text der erscheint bevor das Bild des Servers erscheint ; Nachfolgende Zeilen von eigenen Test's - ich musste mal das mit den "AdvancedSettings2" 3 4 etc. ausklingeln $oRDP.AdvancedSettings2.EnableAutoReconnect = True $oRDP.AdvancedSettings2.allowBackgroundInput = True $oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = True $oRDP.AdvancedSettings5.AudioRedirectionMode = 0 $oRDP.Connect() ObjEvent($oRDP, 'rdpevent_') Func rdpevent_OnLoginComplete() ConsoleWrite('loging complete' & @CRLF) ; copy() EndFunc ;==>rdpevent_OnLoginComplete Func copiar() $remoteclient = "192.168.20.61" $Domain = "FILESERVER" $Username = "companyname1\user" $Password = "XXXXX-XXXXX-XXXXX" ; Map X drive to \\myserver\stuff using current user ;DriveMapAdd("X:", "\\myserver\stuff") ;RunAsWait("companyname1\user","FILESERVER","XXXXX-XXXXX-XXXXX", 0, @ComSpec & ' /c ' & 'copy "\\192.168.20.61\X$\a.txt, "C:\Users\Mantenimiento\Desktop\"', "", @SW_HIDE) ; Map X drive to \\myserver2\stuff2 using the user "jon" from "domainx" with password "tickle" DriveMapAdd("X:", "A:", 0, "companyname1\user", "XXXXX-XXXXX-XXXXX") ConsoleWrite("error " & @error) EndFunc ;==>copiar While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit ;==> Doing this I get this GUI with the Remote Computer: The folder with the pdf files is the one marked. Looking at the remote computer hard disk drives folder I get this: The hdd where the pdf files are is a Network location. I don't know if this is a problem to get the files copied from the remote computer to the local one. I have zero knowledge about networks. Any idea or help would be really apreciatted.