Forum Discussion

AKIMF's avatar
AKIMF
Iron Contributor
Dec 07, 2016

Shorten local OneDrive path to avoid windows path length limitations

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?

 

  • freddavis's avatar
    freddavis
    Copper Contributor

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

    • Chris_Mccormack's avatar
      Chris_Mccormack
      Copper Contributor

      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

  • Tim Adams's avatar
    Tim Adams
    Copper Contributor

    Using LongPath Tool program helps in avoiding such errors.

  • MarkPahulje's avatar
    MarkPahulje
    Brass Contributor

    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.

     

  • Stefano Conti's avatar
    Stefano Conti
    Brass Contributor

    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's avatar
      Stefano Conti
      Brass Contributor

      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

      • AKIMF's avatar
        AKIMF
        Iron Contributor

        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.

    • AKIMF's avatar
      AKIMF
      Iron Contributor

      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:

       

       

      Client version .1122, Windows 7

      • AKIMF's avatar
        AKIMF
        Iron Contributor

        Any hint / solution anyone?

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

  • Joel Parmer's avatar
    Joel Parmer
    Brass Contributor

    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.

Resources