,
This tutorial contains instructions to fix the OneDrive “File source and destination file names are the same” error when opening files from SharePoint.
A few days ago, one of my customers called me to report that they are getting the “The source and destination file names are the same” error when trying to open files in OneDrive app from a SharePoint folder. After solving the problem, I decided to write this guide to help others who have the same problem.
What can cause the OneDrive error “The source and destination file names are the same”?
The “source and destination filenames are the same” error in OneDrive can occur for one of the following three (3) reasons:
- File path is too long: Windows doesn’t allow file paths or filenames over 255 characters. (Source: Maximum Path Length Limitation in Windows).
- Filenames has special characters: The characters ” * : < > ? / | doesn’t allowed in file and folder names. (Source: Restrictions and limitations in OneDrive and SharePoint)
- File(s) are not synced in the device: If the files you are trying to open are not synced and stored on the device’s local disk, then you will get the mentioned error.
How to fix OneDrive with SharePoint error “The source and destination file names are the same”.
Step 1. Verify that the error is not occurring due to a long path address.
The usual cause of the mentioned error is the long path length of the folder or file. This means that if the number of characters in the name of the file and the names of all subfolders in a main folder exceeds 256, you will get the error “The source and destination file names are the same”. So, proceed as follows:
1. Move or copy the file to the parent or the main folder and check if you can open it.
For example: If you receive the error “The source and destination file names are the same”, while trying to open the file “Sales1.pdf” stored in the following location…
- \DocumentsFolders1Folder2Folder3Folder4Folder5Sales1.pdf
…move or copy it to the one of the following locations and then try to open it again.
- \DocumentsFolders1Folder2Folder3Folder4Sales1.pdf
- \DocumentsFolders1Sales1.pdf
2. Now according the result, proceed as follows:
- If the file does not open even after moving it to a parent folder, proceed to step-2.
- If the file opens after moving it to a parent folder, then the error is caused due to long file path. To overcome this problem, you can either keep the file to the parent folder, to shorten the folders’ and file’s name, or to enable the long path support on your Windows 10/11 machine as descripted below:
+ R keys to load the Run dialog box.
4. Type regedit and press Enter, to open the Registry Editor.
5. In Registry Editor, navigate to this key:
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlFileSystem
6a. At the right pane double click to open the LongPathsEnabled REG_DWORD.
6b. Type “1″ in Value data and click OK.
7. Close the Registry Editor, restart your computer and then trying to re-open the file. If the problem persists, continue to step-2.
Step 2. Check that folders and files do not have invalid characters or names.
- OneDrive doesn’t support the following characters in file and folder names:
” * : < > ? / |
- Also, some organizations don’t yet support # and % in names. If you’re a global admin or SharePoint admin in Microsoft 365, see Enabling # and % Support on the SharePoint blog to learn how to allow these characters.
- Additionally, these names aren’t allowed for files or folders: .lock, CON, PRN, AUX, NUL, COM0 – COM9, LPT0 – LPT9, _vti_, desktop.ini, any filename starting with ~$.
Step 3. Set OneDrive to download the file on the device.
Another case when the mentioned error appears, is when they have not been synchronized with the device. So wait until the files are fully synced and downloaded to the device, and ensure that the “Always keep on this device” option in selected.
1. Right-click on the parent folder of the file that you cannot open and click on the option Always keep on this device.
2. Wait a few minutes to download the files locally and then try to open them again.
Step 4. View File Online.
If any of the above helped you to fix the mentioned issue, then you can always view the file online. To do that, right-click on the file and choose View Online.
That’s it! What worked for you?
Let me know if this guide has helped you by leaving your comment about your experience. Please like and share this guide to help others.