Link to home
Start Free TrialLog in
Avatar of jseaman12
jseaman12

asked on

File.Copy Entire Directory to another Directory

I want to copy an entire directory to another destination. I get

Example;

            destination = "C:\jeffrey\"

            strSourcePath = "C:\moves\"
            strDestPath = destination
            File.Copy(strSourcePath, strDestPath)

Error Message;
Could not find a part of the path 'C:\moves\'.

Thanks,
Jeff
ASKER CERTIFIED SOLUTION
Avatar of Bhaskar CP
Bhaskar CP
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Was my idea helpful?
were you able to test my solution?
Avatar of atljarman
atljarman

I found this helpful.  It would be great to see how to loop through and restrict copying of specific files.  For example, if you wanted to copy all files in the directory except those that contained "secure" in the name.