Jump to content

Recommended Posts

Posted

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!

Posted

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')
Posted

#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.
Posted (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 by Andreik

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...