开发者社区> 问答> 正文

Windows xcopy不会将文件复制到目录中

我有这个脚本,我尝试使用以下命令来复制文件目录:“ ../”


del /f foo.zip
cd foo_directory
zip -r foo.zip *
xcopy foo.zip ../
cd ..

但我不断收到此错误:

Does ../ specify a file name
or directory name on the target
(F = file, D = directory)? d
File creation error - Cannot create a file when that file already exists.

Unable to create directory - C:\test\foo_paraent_dir\
0 File(s) copied

我只想将zip复制到上面的目录。

展开
收起
Puppet 2019-12-12 13:11:43 704 0
1 条回答
写回答
取消 提交回答
  • 精于基础,广于工具,熟于业务。

    您看这句报错Cannot create a file when that file already exists.要不更换复制方式,要不就就把目标路径的文件删除了在复制。

    2019-12-12 15:39:53
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
《云服务器运维之Windows篇》 立即下载
TAKING WINDOWS 10 KERNEL 立即下载
ECS运维指南之Windows系统诊断 立即下载