How to say no to all “do you want to overwrite” prompts in a batch file copy?

后端 未结 14 1312
感动是毒
感动是毒 2020-12-23 11:36

By default, copying from the command prompt will prompt you to overwrite files that already exist in the target location.

You can add \"/Y\" to say \"Yes to all\" re

14条回答
  •  清酒与你
    2020-12-23 11:42

    I expect xxcopy has an option for that.

    Bingo:

    http://www.xxcopy.com/xxcopy27.htm#tag_231

    2.3   By comparison with the file in destination
    
        The switches in this group select files based on the
        comparison between the files in the source and those in
        the destination.  They are often used for periodic backup
        and directory synchronization purposes. These switches
        were originally created as variations of directory backup.
        They are also convenient for selecting files for deletion.
    
    2.3.1  by Presence/Absence
    
        The /BB and /U switches are the two switches which select
        files by the pure presence or absence as the criteria.
        Other switches in the this group (Group 2.3) are also
        affected by the file in the destination, but for a
        particular characteristics for comparison's sake.
    
        /BB  Selects files that are present in source but not in destination.
        /U   Selects files that are present in both source and destination.
    

    -Adam

提交回复
热议问题