当我这样做时
robocopy ./empty_folders ./empty_folders_dest /E
我看到以下选项:
Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30
参数/S
(不包括空目录)如何进入,/E
逻辑排除(包括空目录)?倒数(逻辑上)不正确:当我/S
时,我看不到/E
。
进一步详情:
wmic datafile where name="C:\\Windows\\System32\\robocopy.exe" get Version /value
Version=10.0.16299.15
ver
Microsoft Windows [Version 10.0.16299.125]
答案 0 :(得分:1)
你误解了文档。运行“robocopy / ???”看到完整的内置帮助。
/S :: copy Subdirectories, but not empty ones. /E :: copy subdirectories, including Empty ones.
换句话说,/ S将复制子目录除以外的子目录。 / E将复制子目录包括空目录。
答案 1 :(得分:1)
使用/ MIR开关时,我的情况相同,但是如果没有它,这两个开关不会自动添加。因此,我建议这种情况可能与其他使用过的开关有关。
带有/ MIR开关的Robocopy:
#include <vector>
#include <cstdio>
using namespace std;
vector<size_t> transfo (const vector<size_t>& C)
{
vector<size_t> V (C.size());
for (size_t i=0; i<C.size(); i++)
{
V[i] = 0;
for (size_t j=0; j<C.size(); j++)
{
if ((j&i)==i) { V[i] += C[j]; }
}
}
return V;
}
int main()
{
vector<size_t> C = {
/* 000 */ 0,
/* 001 */ 5,
/* 010 */ 10,
/* 011 */ 2,
/* 100 */ 11,
/* 101 */ 3,
/* 110 */ 6,
/* 111 */ 4
};
vector<size_t> V = transfo (C);
for (size_t i=1; i<V.size(); i++) { printf ("[%2ld] C=%2ld V=%2ld\n", i, C[i], V[i]); }
}
不带/ MIR开关的自动复制:
C:\Windows\system32>ROBOCOPY F:\robocopytestv G:\robocopytestw /MIR
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Friday, February 8, 2019 19:40:01
Source : F:\robocopytestv\
Dest : G:\robocopytestw\
Files : *.*
Options : *.* /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /R:1000000 /W:30
------------------------------------------------------------------------------
6 F:\robocopytestv\
100% New File 0 New Bitmap Image.bmp
100% New File 495616 New Microsoft Access Database.accdb
100% New File 6171 New Microsoft Excel Worksheet.xlsx
100% New File 0 New Microsoft PowerPoint Presentation.pptx
100% New File 0 New Microsoft Word Document.docx
100% New File 7942 New OpenDocument Drawing.odg
New Dir 0 F:\robocopytestv\New folder\
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 2 1 1 0 0 0
Files : 6 6 0 0 0 0
Bytes : 497.7 k 497.7 k 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Speed : 72818428 Bytes/sec.
Speed : 4166.703 MegaBytes/min.
Ended : Friday, February 8, 2019 19:40:01
具有/ MIR和/ S开关的Robocopy:
C:\Windows\system32>ROBOCOPY F:\robocopytestv G:\robocopytestw
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Friday, February 8, 2019 19:38:12
Source : F:\robocopytestv\
Dest : G:\robocopytestw\
Files : *.*
Options : *.* /DCOPY:DA /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
6 F:\robocopytestv\
100% New File 0 New Bitmap Image.bmp
100% New File 495616 New Microsoft Access Database.accdb
100% New File 6171 New Microsoft Excel Worksheet.xlsx
100% New File 0 New Microsoft PowerPoint Presentation.pptx
100% New File 0 New Microsoft Word Document.docx
100% New File 7942 New OpenDocument Drawing.odg
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 0 1 0 0 0
Files : 6 6 0 0 0 0
Bytes : 497.7 k 497.7 k 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Speed : 84954833 Bytes/sec.
Speed : 4861.154 MegaBytes/min.
Ended : Friday, February 8, 2019 19:38:12
带有/ MIR和/ E开关的Robocopy:
C:\Windows\system32>ROBOCOPY F:\robocopytestv G:\robocopytestw /S /MIR
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Friday, February 8, 2019 19:41:17
Source : F:\robocopytestv\
Dest : G:\robocopytestw\
Files : *.*
Options : *.* /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /R:1000000 /W:30
------------------------------------------------------------------------------
6 F:\robocopytestv\
100% New File 0 New Bitmap Image.bmp
100% New File 495616 New Microsoft Access Database.accdb
100% New File 6171 New Microsoft Excel Worksheet.xlsx
100% New File 0 New Microsoft PowerPoint Presentation.pptx
100% New File 0 New Microsoft Word Document.docx
100% New File 7942 New OpenDocument Drawing.odg
New Dir 0 F:\robocopytestv\New folder\
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 2 1 1 0 0 0
Files : 6 6 0 0 0 0
Bytes : 497.7 k 497.7 k 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Speed : 12432414 Bytes/sec.
Speed : 711.388 MegaBytes/min.
Ended : Friday, February 8, 2019 19:41:18