0

I know i'm missing something really silly but would like some assistance. I want to create a directory and then add contents into it. The actual location as of now are not the real thing.

C:\Location has some files such as text files or docx or anything.

C:\Location\word.docx and C:\Location\text.txt

I have done

MD "C:\Location\NewName" 
XCOPY C:\Location C:\Location\NewName /EXCLUDE C:\Location\NewName

I read about exclude and I added that in to avoid the cyclic problem but it still says can not perform cyclic copy. I would like to add the text files and docx files into the NewName folder. What am I missing?

2 Answers 2

1

You cannot xcopy a folder when the destination is inside that folder.
That is what is generating the cyclic copy error.

You can xcopy to another location and then move the destination folder to where you need it.

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

1 Comment

Ok. Thank you. I'll rework on the directory structure.
0

if you are simply copying all files from a single folder, just use

copy location\* location\newname\

since only files will be copied, the fact that the destination folder is inside the same folder is irrelevant.

Comments

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.