问题描述
这看起来很简单,也许我只是忽略了,但是我怎么在一个命令中将文件从一个目录复制到另一个目录并在目标目录中重命名它?这是我的命令:
This seems pretty simple and maybe I'm just overlooking the proper flag, but how would I, in one command, copy a file from one directory to another and rename it in the destination directory? Here's my command:
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"
它每次都会提示我:
我想禁止此提示;答案总是 F
。
I want to suppress this prompt; the answer is always F
.
推荐答案
code> xcopy ,请使用 copy
,但没有此问题。
Don't use the xcopy
, use copy
instead, it doesn't have this issue.
xcopy
通常用于执行多个文件/文件夹的递归复制时,或者当您需要其提供的验证/提示功能时。对于单个文件副本, copy
命令工作正常。
xcopy
is generally used when performing recursive copies of multiple files/folders, or when you need the verification/prompting features it offers. For single file copies, the copy
command works just fine.
这篇关于xcopy文件,重命名,抑制“xxx指定文件名...”信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!