[英]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.