How to Solve File Path Length Limitations in Windows 11

Have you ever had problems trying to open, edit, or delete a file or folder in Windows 11 because the name is too long? Have you ever seen error messages like “The file name(s) would be too long for the destination folder” or “The source file name(s) are larger than is supported by the file system”? If yes, then you may face file path length limitations on Windows 11.

A file path is a sequence of characters that indicates the location of a file or folder in the file system. For example, the file path for a file named “contoh.docx” that resides in the “Documents” folder on drive C is “C:Documentscontoh.docx”. The length of the file path is the number of characters present in the file path, including the backslash sign () as a separator between the folder and the file. In this example, the length of the file path is 20 characters.

filepath

Windows 11 has a maximum file path length limit of 260 characters. This means that if you try to create, access, or modify a file or folder with a file path that is longer than 260 characters, you may encounter problems or errors. This limitation is referred to as MAX_PATH and has been around since Windows 95.

However, this limitation is not absolute and can be overcome in several ways. In this article, Bardimin will explain some methods to get around the file path length limitation in Windows 11, either by changing registry settings, using PowerShell, or using third-party applications. We will also provide some tips to prevent the problem of file paths being too long in the future.

Changing Registry Settings

One way to overcome the file path length limitation in Windows 11 is to change the registry settings. The registry is a database that stores important information about the operating system, hardware, and software installed on your computer. By changing certain values in the registry, you can enable a feature called long path which allows you to use file paths that are longer than 260 characters.

To change registry settings, you must have administrator privileges on your computer. In addition, you should be careful because changing the wrong registry can cause system damage or data loss. Therefore, we recommend that you back up your registry before making any changes.

The following are the steps to change registry settings to overcome the file path length limitation in Windows 11:

  1. Open Run by pressing the Windows + R key on your keyboard.
  2. Type regedit and press Enter to open Registry Editor.
  3. In the left pane, navigate to the following folders:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

  1. In the right pane, double-click on the entry named LongPathsEnabled. If this entry does not exist, you can create it by right-clicking on a space in the right pane, selecting New > DWORD (32-bit) Value, and naming it LongPathsEnabled.
  2. Change the data value from 0 to 1 and click OK.
  3. Close Registry Editor and restart your computer.

Once you perform these steps, you should be able to use file paths that are longer than 260 characters in Windows 11 without any problem. However, it’s worth noting that not all apps support this long path feature, so you may still run into errors with some specific apps.

Use PowerShell

PowerShell is a powerful command-line tool and script that allows you to automate and manage various aspects of your operating system, hardware, and software. You can use PowerShell to work around the file path length limitation in Windows 11 by using certain commands that can create, modify, or delete files or folders with long file paths.

To use PowerShell, you must have administrator privileges on your computer. In addition, you should be careful because using the wrong command may cause system damage or data loss. Therefore, we recommend that you back up the files or folders that you want to modify before using PowerShell.

The following are some examples of PowerShell commands you can use to work around file path length limitations in Windows 11:

  • To create a new file with a long file path, you can use the following command:

New-Item -Path “\\?\C:\Folder1\Folder2\Folder3\…\FolderN\File.txt” -ItemType File

This command will create a file named “File.txt” in the last specified folder. You can rename files and folders as you wish, but be sure to use the “\?” prefix at the beginning of the file path to tell PowerShell that you want to use a long file path.

  • To rename a file or folder with a long file path, you can use the following command:

Rename-Item -Path “\\?\C:\Folder1\Folder2\Folder3\…\FolderN\File.txt” -NewName “NewFile.txt”

This command will rename the file “File.txt” to “NewFile.txt”. You can rename files and folders as you wish, but be sure to use the “\?” prefix at the beginning of the file path to tell PowerShell that you want to use a long file path.

  • To delete a file or folder with a long file path, you can use the following command:

Remove-Item -Path “\\?\C:\Folder1\Folder2\Folder3\…\FolderN\File.txt” -Force

This command will delete the “File.txt” file. You can rename files and folders as you wish, but be sure to use the “\?” prefix at the beginning of the file path to tell PowerShell that you want to use a long file path. The -Force option will force the deletion of the file or folder without asking for confirmation.

You can type these commands in Windows PowerShell which you can open by pressing the Windows + X key on your keyboard and selecting Windows PowerShell (Admin). You can also save these commands in a PowerShell script (.ps1) file and run them by right-clicking on the file and selecting Run with PowerShell.

Using Third-Party Apps

If you don’t want to change registry settings or use PowerShell, you can use third-party applications that can help you get around the file path length limitation in Windows 11. Some of these applications are:

  • Long Path Tool: This app is a simple tool that can detect and delete files or folders with long file paths. You can download this app from its official website at https://longpathtool.com/. Once you install this application, you can run it and see a list of files or folders with long file paths. You can select the file or folder you want to delete and click the Delete button. You can also rename or move a file or folder with a long file path by right-clicking on the file or folder and selecting the appropriate option.
  • Path Too Long Auto Fixer: This app is an automated tool that can fix the problem of file paths being too long by randomly renaming files or folders. You can download this app from its official website at https://pathtoolongautofixer.com/. Once you install this application, you can run it and select the drive or folder you want to check. The application will scan the drive or folder and display a list of files or folders with long file paths. You can select the files or folders you want to repair and click the Fix Selected button. The app will rename the file or folder with a shorter, random name.
  • Path Scanner: This app is a scanner tool that can display a list of files or folders with long file paths. You can download this app from its official website at https://pathscanner.com/. Once you install this application, you can run it and select the drive or folder you want to check. The application will scan the drive or folder and display a list of files or folders with long file paths. You can export this list to a text file or Excel for further reference.

Tips to Prevent File Path Too Long Problem

In addition to using the above methods, you can also prevent the file path too long issue in Windows 11 by following these tips:

  • Avoid using file or folder names that are too long or complex. Use a short, simple, descriptive name that can help you easily identify the file or folder.
  • Avoid using special or illegal characters in file or folder names. Special characters are characters that cannot be used in file or folder names, such as \/:*? “ < > |. Illegal characters are characters that can cause problems or errors in the file system, such as % & + = ;, [ ] { } ( ) # $ ^ ‘.
  • Avoid using excessive whitespace in file or folder names. Excessive whitespace can cause errors in some applications or commands. Instead, use hyphens (-) or underscores (_) to separate words in file or folder names.
  • Avoid using a period (.) at the beginning or end of a file or folder name. A dot at the beginning of a file or folder name can hide that file or folder from the file explorer. A dot at the end of a file or folder name can cause errors in some applications or commands.
  • Avoid using file or folder names that are the same as hardware, software, or command names present in Windows 11. For example, don’t use file or folder names like CON, PRN, AUX, NUL, COM1, LPT1, etc. These names can cause conflicts or errors in the operating system or application.

Conclusion

The file path length limitation in Windows 11 is an issue that can interfere with your performance and productivity when working with files or folders. However, you can work around this issue in several ways, such as changing registry settings, using PowerShell, or using a third-party application. You can also prevent this problem by following some tips for using good and correct file or folder names.

Hope this article is helpful and can help you overcome file path length limitations in Windows 11. Thanks for reading.

Latest Articles