none
文件夹改名后文件数量和文件夹数量改变 RRS feed

  • 问题

  • 做了个比较,我从磁带中恢复一个文件夹。检查了一下该文件夹内包含的文件和文件夹数量。在改名该文件夹后文件和文件夹数量与刚刚恢复后的数量不相符。文件和文件夹数量变多了。请问改名后怎么会有文件夹和文件数量的改变。
    2018年11月27日 6:55

全部回复

  • 你好,

    请问你是通过回收站来恢复文件夹的吗。还有你是怎么来比较文件内数量的变化的?你可以看到新增加的文件或文件夹吗?

    最好的祝福,

    Lee


    Just do it.

    2018年11月28日 1:44
    版主
  • 不是回收站,是磁带恢复。我恢复文件夹后查看了恢复的文件夹中的文件和文件夹数量。但是改名以后再才查看发现文件夹和文件数量和之前查看不一样。
    2018年11月28日 8:19
  • 你好,

    我认为改名并不会产生新的文件。 在你进行改名这个操作时,我认为系统可能在改名前和改名后这段时间产生了新的文件,请使用文件管理器中的修改时间进行排序,并截图比较是否有新的文件产生。

    最好的祝福,

    Lee


    Just do it.

    2018年11月28日 8:48
    版主
  • Hi

    Can you remote in to take a look at your side.

    Based on what you mentioned when we are changing the folder name there are files/folder being deleted and created but how can this be possible when there is no copy and paste, cut or delete action been perform by anyone? Having say that how can a folder being rename if there are any open file or deletion in the process?

    There are 500+ folder and 30K files in this reported folder can you advise what are the best option to do it if you want us to compare?

    I cant be doing it manually it will take months to do this.

    2018年12月4日 4:32
  • 你好,

    谢谢你的回复。

    论坛是不支持远程的,如果你想要远程操作你可以升级你的问题,微软提供收费的技术支持。

    系统可能也会产生文件,或者有新的文件被下载到相应的文件夹。

    关于如何进行比较,我建议你使用powershell进行比较。

    (Get-ChildItem -path filepath -Recurse).count

    这条命令是用来检测当前文件夹中的文件的数量的,你可以在改名前改名后进行两次运行,比较两个结果。

    或者说你可以按我上次回复所发布的在文件浏览器中按照文件修改时间进行排序,比较是否有新的文件产生。

    如果说你有做其他什么检测的方法,请将你的截图上传,以获得更好的帮助。

    最好的祝福,

    Lee


    Just do it.

    2018年12月4日 5:49
    版主
  • We run the command you provided, and got below error, would you please guide me how can I do the next step to fix this issue?

    PS C:\Users\limr.ap> (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\data\data\Data\User

    -Recurse).count

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...outlook - Harry:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...nta & ChemChina:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...report\template:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...rts\Biologicals:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...Aug F&A monthly:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...ly Jan ~ August:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...chao\data sheet:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...Aug F&A monthly:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...y consolidation:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...potash contract:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore... 5 year outlook:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...see a good year:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...ly\China potato:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...n coal industry:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...its corn market:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore... mitigate risks:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...nd impact on FI:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...icient capacity:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...o way ex-change:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...e Belt One Road:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore... weekly\publish:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore... Margin Outlook:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...-China nitrogen:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...orts\Resistence:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ReadError: (C:\Temp\Restore...jing conference:String) [Get-ChildItem], PathTooLongExcept

       ion

        + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than

    260 characters, and the directory name must be less than 248 characters.

    At line:1 char:2

    + (Get-ChildItem -path 'C:\Temp\Restore Test\Distributed File System Replication\d ...

    2018年12月7日 8:47
  • Hi,

    Thanks for your reply.

    Your file path longer than 248 characters. So get the error.

    You can actually get to the paths longer than 260 characters by making your call to the Unicode version of Windows API.

    There's a catch though. This work only in Powershell 5.1 minimum.

    You will need to use the following prefix: \\?\

    (Get-ChildItem -path '\\?\C:\Temp\Restore Test\Distributed File System Replication\data\data\Data\User
    
    -Recurse).count

    Best Regards,

    Lee




    Just do it.

    2018年12月7日 9:46
    版主