TestPro Posted March 26, 2022 Share Posted March 26, 2022 Hello, I am new to AutoIt and I am trying to create a script whic copies a folder from a file share server (for example: \\testShare01\folders\folderToCopy) to my local drive (for example: C:\folders\folderDestination) My script looks like this: DirCopy("\foldertoCopy", "C:\folders\folderDestination) I compile the script to a .exe which I will copy into the folder itself. The reason why I do it like this is, that I have file Servers all around the world, so if I am in Amsterdam I do not want to copy the whole folder from Kopenhagen, the reasons for that are obvious I think. Normally I have used a xcopy script for this, which could be found in the file Server folder itself: (xcopy /s /i %~dp0folderToCopy C:\folders\folderDestination) Since I want to create a GUI and some other stuff with AutoIt I chose to change my scripts to AutoIt. But I am already failing at the simple DirCopy function... could you help me? I guess %~dp0folderToCopy does not work in AutoIt? Best regards Link to comment Share on other sites More sharing options...
Solution ad777 Posted March 26, 2022 Solution Share Posted March 26, 2022 you just need to add $FC_OVERWRITE into DirCopy Func: #include <FileConstants.au3> DirCopy(".\foldertoCopy", "C:\folders\folderDestination",$FC_OVERWRITE) TestPro 1 iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to comment Share on other sites More sharing options...
TestPro Posted March 26, 2022 Author Share Posted March 26, 2022 13 minutes ago, ad777 said: you just need to add $FC_OVERWRITE into DirCopy Func: #include <FileConstants.au3> DirCopy(".\foldertoCopy", "C:\folders\folderDestination",$FC_OVERWRITE) Thank you very much!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now