询问者
文件夹改名后文件数量和文件夹数量改变

问题
全部回复
-
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.
-
你好,
谢谢你的回复。
论坛是不支持远程的,如果你想要远程操作你可以升级你的问题,微软提供收费的技术支持。
系统可能也会产生文件,或者有新的文件被下载到相应的文件夹。
关于如何进行比较,我建议你使用powershell进行比较。
(Get-ChildItem -path filepath -Recurse).count
这条命令是用来检测当前文件夹中的文件的数量的,你可以在改名前改名后进行两次运行,比较两个结果。
或者说你可以按我上次回复所发布的在文件浏览器中按照文件修改时间进行排序,比较是否有新的文件产生。
如果说你有做其他什么检测的方法,请将你的截图上传,以获得更好的帮助。
最好的祝福,
Lee
Just do it.
-
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 ...
-
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.