Solgrmonk Posted December 12, 2008 Posted December 12, 2008 Hello, I am new to AutoIT and I want to ask for some help with something I am trying to do. I need to be able to copy a single or multiple files contained in a source directory to all of the folders in a target directory. I need to do the following; Ask user for a Source directory Ask User for a Target directory Copy files from Source directory to Target directory and Sub Folders in Target Directory. Any help provided is GREATLY appreciated!
Andreik Posted December 12, 2008 Posted December 12, 2008 Hello, I am new to AutoIT and I want to ask for some help with something I am trying to do. I need to be able to copy a single or multiple files contained in a source directory to all of the folders in a target directory. I need to do the following; Ask user for a Source directory Ask User for a Target directory Copy files from Source directory to Target directory and Sub Folders in Target Directory. Any help provided is GREATLY appreciated!#include <Process.au3> $SOURCE = FileSelectFolder("SOURCE","") If @error Then Exit $DEST = FileSelectFolder("DESTINATION","",1) If @error Then Exit _RunDOS('xcopy "' & $SOURCE & '" "' & $DEST & '" /E')
Solgrmonk Posted December 12, 2008 Author Posted December 12, 2008 #include <Process.au3> $SOURCE = FileSelectFolder("SOURCE","") If @error Then Exit $DEST = FileSelectFolder("DESTINATION","",1) If @error Then Exit _RunDOS('xcopy "' & $SOURCE & '" "' & $DEST & '" /E') Thanks for the quick reply. I tried this script, but it only copied to the destination folder, not the sub-folders in the destination folder.
Andreik Posted December 12, 2008 Posted December 12, 2008 (edited) Thanks for the quick reply. I tried this script, but it only copied to the destination folder, not the sub-folders in the destination folder.Use _FileListToArrayEx() function by SmOke_N to get all subdirs.Or use DirCopy() function. Edited December 13, 2008 by Andreik
rasim Posted December 13, 2008 Posted December 13, 2008 SolgrmonkWelcome to the forum! Try this:$sSource = FileSelectFolder("Select the source folder", "") If @error Then Exit $sDest = FileSelectFolder("Select the destination folder", "", 1) If @error Then Exit DirCopy($sSource, $sDest, 1)
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