简体   繁体   English

将目录文件复制到批处理文件中的另一个目录,而无需询问?

[英]Copy Directory files to another directory in batch file without asking?

I have created a batch file to copy one folders files to another folder. 我创建了一个批处理文件,将一个文件夹文件复制到另一个文件夹。 This code XCOPY C:\\Temp\\a.txt C:\\Temp2\\a.txt /Q works but when i run this file it ask Overwrite C:\\Temp2\\a.txt (Yes/No/All)? 这段代码XCOPY C:\\Temp\\a.txt C:\\Temp2\\a.txt /Q可以工作,但是当我运行此文件时,它会问是否Overwrite C:\\Temp2\\a.txt (Yes/No/All)? I want to do this without asking this question. 我想这样做而不问这个问题。 How can i do ? 我能怎么做 ? And i want to this for aspx or aspx.cs files 我想要这个用于aspx或aspx.cs文件

From the manual: 从手册中:

/Y Suppresses prompting to confirm you want to overwrite an existing destination file / Y禁止提示您确认要覆盖现有目标文件

So just add the /Y option in order to overwrite all files without asking. 因此,只需添加/ Y选项即可覆盖所有文件而无需询问。

If you want to copy all files that contain "aspx", you can use 如果要复制所有包含“ aspx”的文件,则可以使用

XCOPY C:\Temp\aspx* C:\Temp2\ /Q /Y

You can try this : 您可以尝试以下方法:

XCOPY C:\\Temp\\a.txt C:\\Temp2\\a.txt /Q /Y XCOPY C:\\ Temp \\ a.txt C:\\ Temp2 \\ a.txt / Q / Y

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 批处理文件可将文件从一个目录复制到另一个目录 - Batch file to copy files from one directory to another 如何在批处理文件中复制特定文件的目录 - how to copy directory of specific files in batch file 尝试使用批处理将文件从当前目录复制到另一个目录 - Trying to copy files from current directory to another with batch 批处理文件将文件夹从文本文件复制到另一个目录 - Batch File to copy folders from a text file to another directory 批处理文件以在目录中搜索文件列表并复制到单个文件夹 - Batch file to search directory for list of files and copy to single folder 批处理:如何根据文件名将文件复制到目录 - BATCH: How can I copy files to directory based on file name 批处理脚本 - 在一个目录中的多个文件中查找和替换文本,而不要求用户安装任何程序或将其他文件添加到我的批处理脚本中 - Batch Script - Find and replace text in multiple files in a directory without asking user to install any program or add other files to my batch script 批处理文件使用多个文本文件将文件移动到另一个目录 - Batch File Move files using multiple text files into another directory 批处理文件查找目录中的文件 - Batch file to find files in a directory 从批处理文件的目录中复制文件 - Copy file from batch file's directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM