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

后端 未结 14 1315
感动是毒
感动是毒 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 12:06

    I use XCOPY with the following parameters for copying .NET assemblies:

    /D /Y /R /H 
    
    /D:m-d-y - Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
    
    /Y - Suppresses prompting to confirm you want to overwrite an existing destination file.
    
    /R - Overwrites read-only files.
    
    /H - Copies hidden and system files also.
    

提交回复
热议问题