copying all contents of folder to another folder using batch file?

后端 未结 12 1822
时光取名叫无心
时光取名叫无心 2020-12-12 19:49

I have a folder in C:\\Folder1

I want to copy all the contents of Folder1 to another location, D:\\Folder2

How do I do

12条回答
  •  轮回少年
    2020-12-12 20:31

    RoboCopy did not work for me, and there are some good solutions here, but none explained the XCopy switches and what they do. Also you need quotes in case your path has spaces in it.

    xcopy /i /e "C:\temp\folder 1" "C:\temp\folder 2"

    Here is the documentation from Microsoft:

    XCopy MS Documentation

    /s: Specifies to include subdirectories. Excludes empty subdirectories
    /e: Copies all subdirectories, even if they are empty
    /i: specifies the destination is a folder (Otherwise it prompts you)
    

提交回复
热议问题