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
Avatar of FOX
Flag of United States of America image

Link to home
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 :)

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


Thanks!  This is great!