【问题标题】:Cmd copies twice some files to a destinationCmd 将一些文件复制两次到目标
【发布时间】:2018-11-22 17:03:21
【问题描述】:

C:\My\Download\Location = 存在此文件夹的目录 Naruto,在Naruto 里面有Naruto.mkv

C:\My\Other\Location = 我想要的默认下载位置Naruto 文件夹已移动,里面有Naruto.mkv

这是我运行的命令:

FOR /R C:\My\Download\Location %f IN (.) DO robocopy "%f" "C:\My\Other\Location" /S

此命令在C:\My\Download\Location 中查找文件夹(.)%f 是文件夹)并将其复制到Naruto.mkv 中的C:\My\Other\Location

问题是在C:\My\Other\Location 中甚至还有Naruto.mkv,而它应该只在文件夹Naruto

所以,在命令FOR /R C:\My\Download\Location %f IN (.) DO robocopy "%f" "C:\My\Other\Location" /S之后,我处于这种状态:

C:\My\Other\Location\Naruto\Naruto.mkv

C:\My\Other\Location\Naruto.mkv(这不应该存在)

为什么连Naruto.mkv都复制?

我该如何解决这个问题?

【问题讨论】:

    标签: windows for-loop cmd copy


    【解决方案1】:

    好的,我决定这样做:

    cd C:\My\Download\Location
    FOR /R C:\My\Download\Location %f IN (.) DO move "%f" "C:\My\Other\Location"
    

    【讨论】:

      猜你喜欢
      • 2016-07-14
      • 1970-01-01
      • 2014-08-03
      • 1970-01-01
      • 2017-11-16
      • 1970-01-01
      • 2017-05-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多