Copy files and *replace* them in another folder using CMD? Solved

  1.    #1

    Copy files and *replace* them in another folder using CMD?


    Hello,

    I know there a multiple tutorials online about copying files from one place to another using command line.

    My question is,

    I want to copy one folder to another folder, only thing is I want the files inside it to be replaced directly, without any prompts asking for replacement.

    Is that doable?
      My ComputerSystem Spec

  2. Caledon Ken's Avatar
    Posts : 15,053
    Windows 10 Pro x64 Build 1809
       #2

    Yes.

    Here are the switches for copy.

    /Y

    seems to be what you are looking for.

    Copy Command (Examples, Options, Switches, and More)



    Ken
      My ComputerSystem Spec

  3.    #3

    I like the mirror function in robocopy because it will perform an exact duplication of the source to the destination. In other words, it will even delete files in the destination that don't exist in the source making the destination a perfect replica of the source.

    Eample usage:

    Code:
    robocopy <source> <destination> /mir

    Putting some sample folders in place, it might look like this:

    Code:
    robocopy d:\source e:\destination /mir
    Tip: If you want to see what the command will do without actually performing the operation, just add a /L and it will perform a simulated execution of the command.

    The other nice thing is that it won't bother recopying files that are already present and unchanged on the destination. As a result, if you have a lot of files, or some large files, and only a few changes have taken place, the copy will be very quick since it simply skips those items that are unchanged.
      My ComputerSystem Spec

  4.    #4

    Hi,

    Try to use Long Path Tool, you will find your solution to copy folders with files. All the best.
      My ComputerSystem Spec

  5.    #5

    hsehestedt said: View Post
    I like the mirror function in robocopy because it will perform an exact duplication of the source to the destination. In other words, it will even delete files in the destination that don't exist in the source making the destination a perfect replica of the source.

    Eample usage:

    Code:
    robocopy <source> <destination> /mir

    Putting some sample folders in place, it might look like this:

    Code:
    robocopy d:\source e:\destination /mir
    Tip: If you want to see what the command will do without actually performing the operation, just add a /L and it will perform a simulated execution of the command.

    The other nice thing is that it won't bother recopying files that are already present and unchanged on the destination. As a result, if you have a lot of files, or some large files, and only a few changes have taken place, the copy will be very quick since it simply skips those items that are unchanged.
    Wow! Perfect! Exactly what I needed mate! Thank you!
      My ComputerSystem Spec


 

Related Threads
How to Add or Remove 'Copy To folder' and 'Move To folder' Context Menu in Windows 10 When you press and hold or right click on selected file(s) and folder(s) and click/tap on Copy To folder, it will copy them to a location you select...
Is some time that when i copy or move files on different folders or also files from folders to desktop, the file copied or moved appear after time, not immediately also if the dimesion is very little. Sometime i must select refresh on desktop or F5...
How do I do this in Windows 10? I have a folder of files, and I want to copy the folder and all of its contents onto an external hardisk which already contains a folder of the same name, and also contains some of the files that I am now trying to...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 18:46.
Find Us