If you can’t delete a folder because of error “Source Path Too Long”, continue reading below to fix the problem.
Problem in details: When you try to delete a folder or file with a filename longer than 260 characters, the deletion fails with error “Source Path Too Long: The source file names(s) are larger than is supported by the file system. Try moving to a location which has a shorter path name, or try renaming to shorter name(s) before attempting this operation”
How to fix error “Source Path Too Long” in Windows 10/11 & Windows Server 2016 and later versions.
The “Source Path Too Long” error message in Windows appears when the file name exceeds the maximum allowed length of 260 characters. This limit affects all file operations such as copying, moving, renaming and deleting files or folders. To resolve the problem, apply one of the methods below.
Method 1. Rename or Move the Folder/File.
The first and obvious method, as indicated by the error message, is to rename the folder or file with a shorter name or to move it to another location that has a shorter path. This method is useful if you want to move/rename a few files but is time consuming when you encounter the “source path too long” problem in many files.
Method 2. Enable Long Path & Filename support in Registry.
The second method to resolve the “Source Path Too Long” error, is to bypass the limit of 260 characters by enabling the long path support using the registry.*
* Note: If you own Widows 10/11 Professional or you want to enable the long path support on a Windows Server 2016/2019 you can also follow the instructions on the next method (Group Policy).
1. Press Windows + R keys to open the run command box.
2. Type regedit and press Enter.
2. In Registry Editor, navigate to the following location:
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlFileSystem
3. At the right-pane open the LongPathsEnabled REG_DWORD value and change the value data from 0 to 1.
4. Close the Registry Editor and restart your computer to apply the change.
Method 3. Enable Long Path & Filename support via Group Policy.*
To enable long paths support in Group Policy, on Windows 10/11 Pro and Server 2016 and later editions:
1. Press Windows + R keys to open the run command box.
2. Type gpedit.msc to open the Group Policy Editor.
3. In Policy Editor, go to the following path:
- Computer Configuration > Administrative Templates > System > Filesystem
4a. At the right-pane open the Enable Win32 long paths policy
4b. Set the “Enable Win32 long path” policy to Enabled and click OK.
5. Reboot the computer.
Method 4. Delete the Folder/File using 7zip File Manager.
1. Download and install the 7-Zip archiver program.
2. Now open the 7-Zip File Manager from the programs list.
3a. Navigate to the location of the folder that you cannot delete.
3b. Select the folder.that you cannot delete and then hold down the SHIFT key and press DELETE.
That’s all folks! Did it work for you?
Please leave a comment in the comment section below or even better: like and share this blog post in the social networks to help spread the word about this solution.