Discussion Locked

Batch file - copy folder and contents

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

hi

i need to know the commands for a batch file that copies all the sub folders and files of a given folder

say for example

i have a folder D:\test1 contains many other sub folders and files,
on execting a batch file, it should copy all the contents(folders, sub folders and files) to D:\test2

with out promting for overwriting

pls help me

thanks

2 replies

by infoguy

Actually, /E is the same as using both "/S" and "/E". The proper command to use is:

XCOPY D:\TEST1 D:\TEST2 /Y /R /E /I /K /O

At a command prompt, type XCOPY /?
That will give you a detailed list of options and what they do.

This discussion is closed to new replies.