Renfield-64 Posted January 19, 2018 Posted January 19, 2018 Does anyone else find it annoying when staff create folders within folders to an unnecessary depth, ie; 10 folders deep? Is there a way to prevent users doing this? It certainly is a pain when I have to delete folders that overuse the 256 characters allowed by Windows as it doesn't easily allow deletion. Ideally I would like to set a preset level for users. Any ideas?
ZeroHour Posted January 20, 2018 Posted January 20, 2018 I dont know if there is a way to block it as such as its a quirk of unc/mapped drives although Windows 10/2016 can be enabled to allow you to browse and delete those folders, I cant remember the exact setting to turn it on though.
Arthur Posted January 20, 2018 Posted January 20, 2018 Windows 10/2016 can be enabled to allow you to browse and delete those folders, I can't remember the exact setting to turn it on though. Are you thinking of the "Enable Win32 long paths" setting... www.edugeek.net/forums/windows-10/170886-microsoft-removes-260-character-path-length-limit-windows-10-a.html As of Windows 10 v1709, Microsoft still haven't enabled long path support in File Explorer so the GPO mentioned in that thread has zero effect. 1
free780 Posted January 20, 2018 Posted January 20, 2018 You may be able to powershell to the affected folders.
Arthur Posted January 20, 2018 Posted January 20, 2018 (edited) You may be able to powershell to the affected folders. An issue I found when using PowerShell* to find long paths is that it doesn't find all of them, whereas the Get-ChildItem2 cmdlet from the NTFSSecurity module does because it uses the AlphaFS .NET library instead of relying on Windows. The file system support in .NET is pretty good for most uses. However there are a few shortcomings, which this library tries to alleviate. The most notable deficiency of the standard .NET System.IO is the lack of support of advanced NTFS features, most notably extended length path support (eg. file/directory paths longer than 260 characters). PS C:\WINDOWS\system32> [b]$x = Get-ChildItem -Path 'D:\' -Recurse -EA 0 | Where-Object { $_.FullName.Length -gt 260 }[/b] PS C:\WINDOWS\system32> [b]$x.Count[/b] [b]970[/b] PS C:\WINDOWS\system32> [b]$y = Get-ChildItem2 -Path 'D:\' -Recurse -EA 0 | Where-Object { $_.FullName.Length -gt 260 }[/b] PS C:\WINDOWS\system32> [b]$y.Count[/b] [b]1090[/b] * PowerShell 5.1 and PowerShell Core 6.0.0 both returned the same number of results. Edited January 20, 2018 by Arthur
ricki Posted January 20, 2018 Posted January 20, 2018 I hate silly long paths and file names that are huge Richard
Renfield-64 Posted January 23, 2018 Author Posted January 23, 2018 Hi, thanks for your suggestions guys. The main thing would be a way to prevent them making the folder structure so long in the first place.
NB9457 Posted January 23, 2018 Posted January 23, 2018 An old cheat way I have used in the past is to map a drive to one of the sub folders and delete from there as your machine would then see it a Z:\Short instead of \\Server\Share\User\MassOfFolders.
Renfield-64 Posted January 23, 2018 Author Posted January 23, 2018 The trouble is there could be dozens of folder structures like this.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now