xcopy文件,重命名,抑制“xxx指定文件名...”信息 [英] xcopy file, rename, suppress "Does xxx specify a file name..." message

查看:768
本文介绍了xcopy文件,重命名,抑制“xxx指定文件名...”信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这看起来很简单,也许我只是忽略了正确的标志,但是我怎么在一个命令中将文件从一个目录复制到另一个目录并在目标目录中重命名它?这是我的命令:

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"

它每次都会提示我:


TestConnectionExternal \bin\Debug \whee.config是否在目标上指定文件名
或目录名(F =文件,D =目录)?

Does TestConnectionExternal\bin\Debug\whee.config specify a file name or directory name on the target (F = file, D = directory)?

我想禁止此提示;答案总是 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指定文件名...”信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆