简体   繁体   English

Robocopy 命令不复制文件和文件夹

[英]Robocopy command is not copying files and folders

Im attempting the simplest use of robocopy with powershell:我正在尝试使用 powershell 最简单地使用 robocopy:

robocopy C:\Users\tkeen\Documents\test\ C:\Users\tkeen\Documents\test2\

It doesn't seem to do anything.它似乎没有做任何事情。 This is the response I get back:这是我得到的回复:

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : Friday, April 22, 2022 5:51:41 PM
   Source : C:\Users\tkeen\Documents\test\
     Dest : C:\Users\tkeen\Documents\test2\

    Files : *.*

  Options : *.* /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

                           0    C:\Users\tkeen\Documents\test\

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         0         0         0         0         0         0
   Bytes :         0         0         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
   Ended : Friday, April 22, 2022 5:51:41 PM

I tried with other options like \MIR but then I just get a "ERROR: Invalid Parameter #3: \mir" message.我尝试了其他选项,如 \MIR,但随后我只收到“错误:无效参数 #3:\mir”消息。 Not sure what Im doing wrong.不确定我做错了什么。

Try Below试试下面

robocopy "Source" "destination" /MIR /E /XO /xx /tee /R:2 /W:1 /SEC /LOG:"o/p path"

MIR - mirrors directory - deletes files which is present in destination but not in source E - copies subdirectories even folder is empty X0 - excludes older files - we can say for incremental xx - excludes extra files - will not delete extra files in destination (XX overtakes MIR) tee - gives output in command prompt also R - Number of Retries on failure W - Wait time between Retries SEC - copy with security LOG - output path MIR - 镜像目录 - 删除目标中存在但源中不存在的文件 E - 复制子目录,即使文件夹为空 X0 - 排除旧文件 - 我们可以说增量 xx - 排除额外文件 - 不会删除目标中的额外文件(XX超越 MIR) tee - 在命令提示符下也给出 output R - 失败时的重试次数 W - 重试之间的等待时间 SEC - 使用安全日志复制 - output 路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM