How to Fix Can’t Delete Folder Source Path Too Long in Windows 11

Attempting to delete an obsolete folder hierarchy, node_modules directory, or deeply nested backup in Windows 11 only to be blocked by the error dialogue: “The source file name(s) are larger than is supported by the file system. Try moving to a location which has a shorter path name…” or “Destination Path Too Long” is a common administrative headache. By default, legacy Win32 API boundaries enforce a maximum path limit of 260 characters (MAX_PATH). When deeply nested folders exceed this limit, File Explorer refuses to delete, rename, or move them.

Delete the Entire Directory Instantly Using Robocopy Mirroring

The fastest and most reliable native method to purge deeply nested folders exceeding the 260-character path limit is using the built-in Windows Robust File Copy tool (robocopy) in mirror mode:

  1. Press Windows Key + R, type cmd, and press Enter to open Command Prompt.
  2. Create a temporary, empty directory on your root drive by typing:
    mkdir C:\empty_temp
  3. Execute the robocopy purge command, mirroring the empty directory over your locked directory (replace the target path with your actual folder path):
    robocopy C:\empty_temp "C:\path\to\locked\folder" /purge
  4. Robocopy operates at low filesystem levels, completely bypassing Win32 path string limits. It rapidly wipes all contents inside the nested folder structure.
  5. Finally, remove the now-empty locked folder and temporary directory:
    rmdir "C:\path\to\locked\folder"
    rmdir C:\empty_temp

Enable Win32 Long Paths in Windows 11 Local Group Policy

Windows 11 includes a native operating system toggle that removes the 260-character MAX_PATH limit across NTFS and ReFS filesystems:

  1. Press Windows Key + R, type gpedit.msc, and hit Enter to open the Local Group Policy Editor.
  2. Navigate through the left tree: Computer Configuration > Administrative Templates > System > Filesystem.
  3. In the right pane, locate the policy named Enable Win32 long paths.
  4. Double-click the policy and set it to Enabled.
  5. Click Apply, then click OK.
  6. Reboot your computer. Windows File Explorer and modern shell commands will now natively access, rename, and delete file paths up to 32,767 characters.

Enable Long Paths via the Windows Registry (For Windows Home)

If you are running Windows 11 Home edition which lacks the Group Policy Editor, activate long path support via the registry:

  1. Press Windows Key + R, type regedit, and hit Enter.
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  3. Locate the DWORD value named LongPathsEnabled.
  4. Double-click LongPathsEnabled and change its value data from 0 to 1.
  5. Click OK and restart your PC.

Shorten the Path Tree by Renaming Parent Folders

If you need to salvage specific files from the nested folder before deleting the rest:

  1. Navigate to the topmost parent folder in File Explorer.
  2. Rename each intermediate directory to a single character (e.g. rename ProjectBackup2025_Archive_LongDirectoryName to a).
  3. Step into the next child directory and rename it to b.
  4. By reducing folder names to single letters, the overall path length drops below 260 characters, allowing File Explorer to move files or delete the folder tree cleanly.

Delete via Command-Line Extended Path Syntax

Standard Command Prompt deletion commands can handle paths up to 32,767 characters if you prepend the extended-length path prefix (\\?\):

  1. Open Command Prompt as Administrator.
  2. Use the rmdir command formatted with the universal prefix:
    rmdir /s /q "\\?\C:\very\deeply\nested\folder\path"
  3. The /s flag removes all files and subdirectories, while /q operates in quiet mode without confirmation prompts.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.