2

I know how to do it with different commands but is there a way to make it so copy-item cmdlet also copies directories to the target folder for example if I wanted to copy everything in the C:\users folder including all directories and sub directories is it possible to do with the copy-item command.

1 Answer 1

3

You should be able to do it with:

copy-item C:\users -recurse

copy-item C:\users -destination c:\somewhereelse -recurse

The first way assumes you are currently in the destination folder, the second way is explicit.

Sign up to request clarification or add additional context in comments.

1 Comment

I suggest to use -force parameter if hidden or system files are present in source folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.