一批与XCOPY复制文件 [英] batch to copy files with xcopy

查看:115
本文介绍了一批与XCOPY复制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查互联网上的一些例子,但我不能让我的(第一个)批处理文件来工作。我想我的自动文件从文件夹复制到另一个人,但没有发生。

 关闭@echo
XCOPYC:\\源\\C:\\目标\\/ C / D / I / Y
出口

你能看到什么了?

谢谢!

更新:我已经做了巴厘岛C中列出的命令,但它仍然无法正常工作。见快照

  XCOPY C:\\文件夹1 C:\\文件夹2 \\文件夹1 / T / E / I / Y
XCOPY C:\\文件夹1 C:\\文件夹2 \\ / T / E / I / Y

图像: 1

我有CTRL + C停止它。

PS:我是在Win 7

更新(解决方案):
有用!问题是名字XCOPY,蝙蝠在我的桌面,我是从那里运行命令,所以它正在执行我的桌面而不是Windows之一xcopy.bat文件..我不得不重新命名为myxcopy文件。蝙蝠

 关闭@echo
XCOPYC:\\源,C:\\目标/ C / D / I / Y
出口


解决方案

测试最该为我工作的开关后:

  XCOPY C:\\文件夹1 C:\\文件夹2 \\文件夹1 / T / E / I / Y

这将在文件夹文件夹1 复制到文件夹文件夹2 。因此,目录树将如下所示:

  C:
   文件夹1
   FOLDER2
      文件夹1

I have checked some examples on internet but I can't get my (first) batch file to work. I would like to copy automatically my file from a folder to another one but nothing happen.

@echo off
xcopy "C:\source\" "C:\target\" /c /d /i /y
exit

Could you see anything wrong?

Thanks!!

Update: I have done the command given by Bali C but it still doesn't work. See snapshot

xcopy C:\folder1 C:\folder2\folder1 /t /e /i /y
xcopy C:\folder1 C:\folder2\ /t /e /i /y

image: 1

I have to stop it with CTRL + C.

PS: I'm on Win 7

Update (Solution): It works! The problem was the name xcopy,bat on my Desktop, and I was running the command from there, so it was executing the xcopy.bat file of my desktop instead of the Windows one.. I had to rename the file with "myxcopy.bat" :

@echo off
xcopy "C:\source" "C:\target" /c /d /i /y
exit

解决方案

After testing most of the switches this worked for me:

xcopy C:\folder1 C:\folder2\folder1 /t /e /i /y

This will copy the folder folder1 into the folder folder2. So the directory tree would look like:

C:
   Folder1
   Folder2
      Folder1

这篇关于一批与XCOPY复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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