Link to home
Start Free TrialLog in
Avatar of RayT
RayTFlag for United States of America

asked on

Copy Large Number of Files Using PowerShell

How do you use PowerShell to copy all files in a directory (with all sub-folders) on the drive to another drive?

For example

xcopy c:\test\*.* d:\test /s
ASKER CERTIFIED SOLUTION
Avatar of FOX
FOX
Flag of United States of America 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
I agree with Fox Robocopy is the way to go.
However if you need to do it with powershell for some reason the Copy-Item command using the -Recurse option would copy all sub folders.
I've been trying to substitute robocopy and xcopy with my PowerShell script :)

https://gallery.technet.microsoft.com/scriptcenter/Copy-Files-from-folderA-to-29710ef9

So I'd go and use my script.
Avatar of RayT

ASKER

Thanks!  This is great!