cannot open the file error

Fix Cannot open the file because the file path is more than characters in Windows 11/10

If you are receiving the following error while opening any documents, then this article is intended to help you to fix this issue. You will receive the full error message like this “Cannot open the file because the file path is more than 259 characters. Try shortening the path or filename.” Mostly you’ll receive this error if you are trying to open any file from the path or the file which is having really long file name. Recently one user reported that she is not able to open the excel file from SharePoint, we found the file SharePoint path is really long. After moving the file to some other location with a shorter path length, she was able to open the excel file. In this article, we are going to see the resolution methods to fix Cannot open the file because the file path is more than characters error in Windows 11/10.

Fix Cannot open the file because the file path is more than characters Error:

Once you received this error, just close the error window and all opened documents and files on your system. Follow the suitable resolution methods below.

Solution 1: Rename the File:

If you are unable to copy or open any particular file from your system or from any external media, then check the file name, if the file name is more than 260 characters, then try to rename it to a Short name.

If the file path is more than 260 Characters, then you can’t be able to open the particular file or documents. So, move the particular file to some other location with a shorter file path.

Solution 2: Enabling the Long Paths in Windows:

The limitation is set by the Win32 API library, in Win 32 API the MAX_PATH value is set by 260. Most of the standard applications, including Windows Explorer do not work correctly with long path files exceeding 256 characters. If you are receiving the same error, then the only solution is to enable the Win32 Long path in Windows 10/11.

You can enable Long paths in Windows by using two different methods.

Using Group Policy Editor:

Open Run command by pressing Windows + R and type gpedit.msc and hit enter, this command will open the Group Policy Editor.

Now navigate to the following path.

Computer Configuration > Administrative Templates > System > Filesystem

From the left-hand side click on the FileSystem and from the right-hand side look for the Policy named Enable Win32 long paths.

Enable win32 long paths

Double click on the Enable Win32 long path policy and open policy settings, Choose Enabled and click on Apply and OK.

enable policy to Fix Cannot open the file

Close the Group Policy Editor and restart the system once.

After restart try to access the file, Mostly this will resolve the issue, if you are using Windows 10/11 home edition then use the Registry Editor method.

Using Registry Editor:

Note: Modifying the Registry is risky, and it causes irreversible damage to your OS Installation Follow the steps correctly. Friendly advice Before Modifying Registry Creating Restore Point is recommended.

Open Run command by pressing Windows + R and type Regedit and hit enter. This command will open the Registry editor console.

Now navigate to the following path.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

From the left-hand side click on the FileSystem and from the right-hand side look for the DWORD named LongPathsEnabled.

Double click on the LongPathsEnabled DWORD and set the Value data as 1 and click on OK.

enable long paths to Fix Cannot open the file

Close the Registry Editor and restart the system once, This will enable the Win32 Long paths in Windows 11/10.

1 thought on “Fix Cannot open the file because the file path is more than characters in Windows 11/10”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top