Forum Discussion
Shorten local OneDrive path to avoid windows path length limitations
As I understand it, you want to shorten the local path without changing your organization's name globally. Here are some solutions that might help you achieve this.
Recommended Solution: Group Policy / Intune (The Supported Method)
Microsoft released a specific policy to address this exact scenario. This is the cleanest, most reliable approach as it preserves all sync relationships and Files On-Demand functionality.
For Domain-Joined Computers:
- Open Group Policy Management Console
- Navigate to: Computer Configuration > Administrative Templates > OneDrive
- Enable the policy "Set a custom name for the OneDrive folder"
- Specify your desired short name (e.g., OD or OneDrive)
- Apply the policy and run gpupdate /force
For Intune / Azure AD Managed Devices:
- Deploy the same setting via the OneDrive Administrative Template in Intune (Configuration Profiles > Administrative Templates)
Once applied, OneDrive will automatically rename the local folder from OneDrive - VeryLongCompanyName to your chosen short name. Existing files remain intact, and no re-sync is required.
Alternative Manual Method (If You Cannot Use Group Policy)
If administrative policies are not available in your environment, you can safely relocate the folder using this procedure. I recommend testing with a small dataset first.
- Exit OneDrive completely — right-click the cloud icon in the system tray and select Exit
- Rename the folder — change C:\OneDrive - VeryLongCompanyName to C:\OneDriveShort (or your preferred short name)
- Update the registry key — navigate to:
HKEY_CURRENT_USER\Software\Microsoft\OneDrive\Accounts\Business1
Locate the UserFolder string value and update it to match your new folder path
4. Restart OneDrive — sign in when prompted. The client will recognize the existing files in the new location and perform a verification scan rather than a full re-download
Important Considerations
- Windows Long Path Support: As noted by Joel Parmer in the discussion, Windows 10 (1607+) and Windows 11 support paths up to 32,767 characters when the "Enable Win32 long paths" policy is enabled. However, shortening the base path via the methods above remains the more reliable solution, especially for legacy applications.
- What to Avoid: While symbolic links (mklink /j) may appear to work, they can interfere with Files On-Demand status indicators and are not recommended for the root OneDrive folder.
Summary…
The Group Policy method is the only fully supported approach that seamlessly renames the folder, updates the sync metadata, and preserves all placeholder states without requiring a re-sync. If you do not have access to Group Policy or Intune, the manual registry method above provides a clean alternative when executed carefully.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.