假设我在C:\test目录中,我有C:\test\myHugeFolder目录和C:\test\backup目录 - 我想将myHugeFolder从cmd.exe命令提示符复制到backup 。
所以,我认为通过使用相对路径, xcopy这种用法是正确的:
C:\test> xcopy myHugeFolder backup\ /s /e问题是, xcopy在这里搅拌了15分钟,还列出了myHugeFolder每个文件,所以我认为一切都很好 - 然后当它完成时,我会查看backup ,而没有myHugeFolder ; 事实上,当我搜索myHugeFolder ,只有原始版本:
C:\test>dir myHugeFolder* /s Volume in drive C has no label. Volume Serial Number is FFFF-FFFF Directory of C:\test 18-10-2015 16:26 <DIR> myHugeFolder 0 File(s) 0 bytes Total Files Listed: 0 File(s) 0 bytes 1 Dir(s) 2.419.708.346.368 bytes free所以,显然这不是正确的命令行 - 我哪里出错了, xcopy的正确调用是做什么样的副本?
Let's say I'm in C:\test directory, where I have C:\test\myHugeFolder directory and a C:\test\backup directory - and I'd like to copy myHugeFolder into backup from cmd.exe Command Prompt.
So, I thought this usage of xcopy is correct, by using relative paths:
C:\test> xcopy myHugeFolder backup\ /s /eThe thing is, xcopy here was churning for like 15 minutes, also listing each file in myHugeFolder, so I thought all was fine - then when it finished, I look into backup, and there no myHugeFolder; in fact when I search for myHugeFolder, there's only the original:
C:\test>dir myHugeFolder* /s Volume in drive C has no label. Volume Serial Number is FFFF-FFFF Directory of C:\test 18-10-2015 16:26 <DIR> myHugeFolder 0 File(s) 0 bytes Total Files Listed: 0 File(s) 0 bytes 1 Dir(s) 2.419.708.346.368 bytes freeSo, obviously that is not the right command line - where am I going wrong, and what is the right invocation of xcopy to do this kind of a copy?
最满意答案
问题中的测试是错误的。
C:\test> dir myHugeFolder此命令不会列出复制到C:\ test \ backup文件夹的任何内容。
正确的测试更像是这样的:
C:\test> dir backup它会显示C:\ test \ myHugeFolder的内容被复制到C:\ backup ,而不是C:\ test \ backup \ myHugeFolder 。
如果想要在C:\ test \ backup \ myHugeFolder中复制C:\ test \ myHugeFolder ,一种方法是:
C:\test> XCOPY myHugeFolder backup\myHugeFolder /E /I之后,以下命令将显示myHugeFolder容器的所需副本:
C:\test dir backup\myHugeFolderThe test in the question is wrong.
C:\test> dir myHugeFolderThis command will not list anything copied to the C:\test\backup folder.
A correct test is more like this:
C:\test> dir backupIt would show that the contents of C:\test\myHugeFolder was copied into C:\backup, not C:\test\backup\myHugeFolder.
If one wanted a duplicate of C:\test\myHugeFolder in C:\test\backup\myHugeFolder, one way to do that would be:
C:\test> XCOPY myHugeFolder backup\myHugeFolder /E /IAfter which the following command would show the desired copy of the myHugeFolder container:
C:\test dir backup\myHugeFolder更多推荐
发布评论