Windows: The File Name or Destination Path You Specified is Not Valid or Too Long
This article applies to: Shared File Services
Microsoft Windows has a MAX_PATH limit of ~256 characters. If the length of the path and filename combined exceed ~256 characters you will be able to see the path/files via the Windows Explorer, but may not be able to delete/move/rename these paths/files.
Applications which utilize UNC paths (such as robocopy) and Macintosh (MacOS) systems accessing CIFS do not have the MAX_PATH limitation and can cause this condition.
A CIFS share containing a file structure which exceeds MAX_PATH may be remediated in the following 3 ways:
Rename or move a deep folder.
If possible rename or move the folder(s) so that the target files that are deeper than the MAX_PATH no longer exist. If you do this, start at the root folder (or any other convenient place), and then rename or move folders/files so that they have shorter names.
Utilize UNC pathing in Windows Explorer.
Note: This allows you to browse down the sub-folders to a path length of ~512 characters below the Network Mapped Drive. If your path length is still excessive, start this process by establishing a Network Mapped Drive at a deeper level, closer to the 256 character MAX_PATH as the starting point.
Open Windows Explorer.
( , All Programs, Accessories, Windows Explorer)
Select the existing Network Mapped Drive to your share.
(R: in this example)
Using the Network Mapped Drive letter, access the UNC path.
Enter \\?\’drive-letter’\ as shown below) and then press Enter.
- Access and correct the file system as necessary.
- Open Windows Explorer.
Attempt remediation utilizing a Macintosh (MacOS) system.
Since Macintosh systems aren’t limited by the Microsoft MAX_PATH limit you may be able to browse/rename the path/files as required from a MacOS system.
- If none of these options work for you, use the form to contact Shared File Services for guidance.
Note: The MAX_PATH limit also impacts restoration of deleted files from snapshots. If file restoration from snapshots is necessary on files which exceed MAX_PATH, it may be possible via the above methods.