command-line - xcopy 文件、重命名、抑制 "Does xxx specify a file name..."消息

标签 command-line command-prompt xcopy

这看起来很简单,也许我只是忽略了 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/

相关文章:

java - Gradle并行执行命令行

ubuntu - 长时间输出后在终端/命令提示符中查看所有内容

bash - 我可以告诉 bash 在当前执行的命令完成后运行命令吗?

python - 如何从命令提示符运行 Pygame 零程序?

windows - 如何在 Windows 中查找路径长度大于 260 个字符的文件?

powershell - 如果不存在,如何将更新的文件复制到新文件夹并创建目录作为源?

windows - 批处理文件复制不起作用,告诉我找不到指定的文件

java - 检查命令行参数是否按有效顺序传递

command-line - 批量启动命令未打开程序

mysql - 命令提示符在启动 mysql 时挂起