这看起来很简单,也许我只是忽略了 proper flag ,但是我如何在一个命令中将文件从一个目录复制到另一个目录并在目标目录中重命名?这是我的命令:
if exist "bin\development\whee.config.example"
if not exist "TestConnectionExternal\bin\Debug\whee.config"
xcopy "bin\development\whee.config.example"
"TestConnectionExternal\bin\Debug\whee.config"
它每次都会提示我以下内容:
Does TestConnectionExternal\bin\Debug\whee.config specify a file name or directory name on the target (F = file, D = directory)?
我想抑制这个提示;答案始终是F
。
最佳答案
我用
echo f | xcopy /f /y srcfile destfile
绕过它。
关于command-line - xcopy 文件、重命名、抑制 "Does xxx specify a file name..."消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3018289/