Shorten local OneDrive path to avoid windows path length limitations

Iron Contributor

When we set up OneDrive for business, we keep the same local path on every pc:

c:\OneDrive

Since our company name is quite long, every synced SharePoint will be somthing like:

c:\OneDrive\veryveryverylongcompanyname\project_xxxx

 

Currently we are moving some local network drive folders to SharePoint or Outlook Groups and are facing path length conflicts due to the long base path. Any way to shorten your company name without changing it globally?

 

14 Replies

May not be a solution but information but with Windows 10 build 1607 (Anniversary Edition), the file path limitation of the OS has been lifted to 32,767 giving plenty of space to stretch those file paths out.

successfully done this in my pc:

 

1) exit One drive app (on icon bottom right, mouse dx > exit)

2) rename one drive folder from "/vvvveerrrrrrrrryyyyyyyyyyy-llllllllllloooooooonnnnnnnnnngggggggg" ... to "work" or something .. 🙂

3) restart pc.

4) the onedrive app start to compare the folder content with the online one.

In my case almost immediately confirm the structure and file prescence (surely not re-downloaded 4GB..)

bye !

@Stefano Conti

Sadly that doesn't work for me. When I change the folder and restart, I will get the following error message and the client will create new folders and resync the whole data afterwards:

Unbenannt.PNG

 

 

Client version .1122, Windows 7

Any hint / solution anyone?

Even with the new client, renaming the base path is not possible.

Hi all,

since yesterday afternoon I successfully changed (renamed) Onedrive name in 5 pc.

Here the complete working procedure :

 

  1. exit One drive app (on icon bottom right, mouse dx > exit)

  2. rename one drive folder from

    "OneDrive - OldVeryLongNameCompany"     to     "OneDrive - COMPANY"

     

    IMPORTANT: the new "COMPANY" name was previously set in O365 Admin pane (gear icon > Organization profile > name othe Organization.

  3. restart pc.

  4. onedrive app auto-start but does not find the previous folder.

  5. a box appears: RETRY or CONFIGURE. --> CONFIGURE

  6. Input your credentials (O365 account, then password)

  7. OneDrive suggest to use the new renamed folder (into which of course file are yet in).

  8. Choose "use this position" option (or similiar)

  9. OneDrive requires to specify which folders and files you want to sync.
    In my case I wanted to keep synched all files and folders. --> go ahead
  10. the sync start. You can check the status on icon bottom right, initially with double-arrow, but soon it disappears.
  11. In any of our case no further sync was necessary. It just compares the local and remote files information. It took about 5' to check 4GB data (5.000 files).
  12. Once finished, probably the "OneDrive - COMPANY" folder will show all file still in sync (double arrow), while the bottom right icon seems to have finished. --> RESTART PC.

Enjoy !

Stefano

Hi @Stefano Conti,

 

thanks for the solution. Unfortunately changing the organization name also changes the billing name since it is global. Thus I (currently) may not shorten it.

The maxmimum path length has been increased (doubled) recently. Have you tried syncing in the last few weeks?

@bart_vermeersch

yes, today on a Windows 10 14393.1198 machine. Pathlengs somehow exceeded the limit.

 

Where should the limit be nowadays? Is the rollout global yet?

 

The max length is now around 400. From my own experience I can say that the max length in windows is more limiting.

 

I was unable to create this long path length directly in Windows, I had to create the folders and files in OneDrive after which they were properly synced.

I had ran into this problem constantly and to do this systematically for my customers was a pain. So I built a tool to fix this issue. 
Path Too Long Auto Fixer (http://pathtoolongautofixer.blogspot.com/) scans for directories and filenames that are longer and 260 characters, and auto shortens them. You have options how the shortening process works, like removing Unicode spaces, hyphens/dashes, underscores and punctuations and more. Try demo for free.

 

Using LongPath Tool program helps in avoiding such errors.

@Hans Brender 

I currently reran into this problem. Anyone found a solution to change the company name without changing the billing name? Or at least change the company name für OneDrive only?

 

Same topic here:

https://techcommunity.microsoft.com/t5/onedrive-for-business/how-can-i-force-onedrive-to-use-a-new-c...

Long PathTool is a software that will let you easily delete, copy or rename long path files.

@freddavis mklink /j c:\onedrive "C:\OneDrive - My long company name with spaces in"

then cd c:\onedrive etc

 

useful if you use the c:\onedrive path in powershell scripts etc

 

wrap it in cmd /c 'mklink /j c:\onedrive "C:\OneDrive - My long company name with spaces in"' if you're running from powershell

 

Chris