Prefixing the file name with “\\?\” can work around the Windows 260 characters (up to 32,000 characters) file name limit in some command line utilities. For example, for local file, dir \\?\c:\longfilename.txt.
However, the syntax is different on a UNC name, it needs to be \\?\UNC\servername\share\longfilename.txt. For example, dir \\?\UNC\fileserver\dept\it\longfilename.txt.
Not all the command line utilities support this syntax.
- Icacls - support
- PowerShell (get-acl) - not support, because of .NET
For more info see
Long Paths in .NET, Part 1 of 3
No comments:
Post a Comment