Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving files on different drives

Status
Not open for further replies.

whitesox12

Programmer
May 2, 2006
9
US
How can I copy or move a directory and subdirectories to a new directory from C drive to E drive.
I have one Master directory that contains several sub-directories, each sub-directory contains several files.
I want to check if a sub-directory is older than 2 days copy or move this sub-directory and all the files in it to a different drive. And recursively loop through all the sub-directories.

Any help is appreciated.

Thanks
 
If you are looking for a perl solution try the File::Copy module. As you already know the rename() function will not "move" files across drives.
 
You'll still have to manually delete the original files though

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top