xcopy 文件,重命名,禁止“xxx 是否指定文件名...";信息 [英] xcopy file, rename, suppress "Does xxx specify a file name..." message

查看:35
本文介绍了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 "bindevelopmentwhee.config.example"
  if not exist "TestConnectionExternalinDebugwhee.config"
    xcopy "bindevelopmentwhee.config.example"
          "TestConnectionExternalinDebugwhee.config"

它每次都会提示我以下内容:

It prompts me with the following every time:

TestConnectionExternalinDebugwhee.config 是否指定文件名或目标上的目录名称(F = 文件,D = 目录)?

Does TestConnectionExternalinDebugwhee.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.

推荐答案

不要使用 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天全站免登陆