Sunday, February 23, 2020

Office 365 SharePoint and OneDrive for Business pathname limitations

Office 365 SharePoint and OneDrive for Business allow maximum pathname for files and folders to be 400 characters.
This limit applies to the total length of the URL path to a folder or a file in SharePoint Online and OneDrive for Business but not to the length of any parameters. Also, these limitations apply only to un-encoded URLs, not to encoded URLs.
For additional information on SharePoint Url composition, refer to the details below:
The total length of a SharePoint URL equals the length of the folder or file path, including the protocol and server name and the folder or file name, plus any parameters that are included as part of the URL.
The formula is as follows:

URL = protocol + server name + folder or file path + folder or file name

For example, the following is a typical URL path to a file stored in SharePoint:

http://www.contoso.com/sites/marketing/documents/Shared%20Documents/Promotion/Some%20File.xlsx
Where the parts of the URL path are as listed in the following table.
URL partExample
Protocolhttp://
Server namewww.contoso.com/
Folder or file pathsites/marketing/documents/Shared%20Documents/Promotion/
File nameSome%20File.xlsx

New MAXPATH limits in SharePoint and OneDrive

Last month we announced support for # and % across SharePoint and OneDrive (https://techcommunity.microsoft.com/t5/SharePoint-Blog/New-support-for-and-in-SharePoint-Online-and-...) and now in addition to adding support for # and % we’re also increasing MAXPATH or otherwise SharePoint and OneDrive's Url path length restrictions from 256 Unicode code units to 400. 

This new limit section applies to the total length of the URL path to a folder or a file in SharePoint Online and OneDrive for Business but not to the length of any parameters. Also, these limitations apply only to un-encoded URLs, not to encoded URLs. There is no limit to encoded URLs in SharePoint Online and OneDrive for Business.

For additional information on SharePoint Url composition, refer to the details below:

The total length of a SharePoint URL equals the length of the folder or file path, including the protocol and server name and the folder or file name, plus any parameters that are included as part of the URL.

The formula is as follows:

URL = protocol + server name + folder or file path + folder or file name+ parameters

For example, the following is a typical URL path to a file stored in SharePoint:
http://www.contoso.com/sites/marketing/documents/Shared%20Documents/Promotion/Some%20File.xlsx
Where the parts of the URL path are as listed in the following table.
 
URL part  Example
Protocol http://
Server name www.contoso.com/
Folder or file path sites/marketing/documents/Shared%20Documents/Promotion/
File name Some%20File.xlsx

The limit applies to the combination of path and name after decoding, so it is sites/marketing/documents/Shared Documents/Promotion/Some File.xlsx.

Saturday, February 22, 2020

Destination Path Too Long in Windows - Effectively Solved!

Why Destination Path Too Long Happens?

When you copy or move a file or a folder to another path on your Windows, you may receive an error message saying Destination Path Too Long.
Destination Path Too Long
Why does this issue happen?
In theory, Windows has a 256/260 folder and name restriction and this is the main cause of the Destination Path Too Long Windows issue.
This error will interrupt your operation. You need to first fix this issue and then copy or move your file or folder. In this post, we show you some methods that can effectively solve this issue.

Solution: Shorten the Name for the Parent Folder

This is the easiest method to fix Destination Path Too Long. But, you should know that it is not available all the time especially when you have numerous files that exceed the length restriction.
If you only have individual files or folders that are bothered by this issue, you can just shorten their names and then execute your operation to see whether the issue goes away.
If you still see the Destination Path Too Long error message, you need to try the next solution.

How to Make Windows 10 Accept File Paths Over 250+ Characters

With the Anniversary Update of Windows 10, you can finally abandon the 260 character maximum path limit in Windows. You just need to make a minor edit to the Windows Registry or Group Policy. Here’s how to make it happen.

wmp_top

RELATED: What's New in Windows 10's Anniversary Update

Before Windows 95, Windows only allowed file names that were eight characters long, with a three character file extension–commonly known as an 8.3 filename. Windows 95 abandoned that to allow long file names, but still limited the maximum path length (which includes the full folder path and the file name) to 260 characters. That limit has been in place ever since. If you’ve ever run into this limit, most likely it was when you were trying to copy deep folder structures into other folders, such as when copying the contents of a hard drive to a folder on another drive. The Windows 10 Anniversary Update finally adds the option to abandon that maximum path length.


There is one caveat. This new setting won’t necessarily work with every application out there, but it will work with most. Specifically, any modern applications should be fine, as should all 64-bit applications. Older 32-bit applications need to be manifested in order to work, which really just means that the developer has indicated in the application’s manifest file that the application supports longer paths. Most popular 32-bit apps should experience no problem. Still, you don’t risk anything by trying the setting out. If an application doesn’t work, the only thing that will happen is that it won’t be able to open or save files that are saved in places where the full path exceeds 260 characters.

Home Users: Remove the 260 Character Path Limit by Editing the Registry
If you have a Windows Home edition, you will have to edit the Windows Registry to make these changes. You can also do it this way if you have Windows Pro or Enterprise, but feel more comfortable working in the Registry than Group Policy Editor. (If you have Pro or Enterprise, though, we recommend using the easier Group Policy Editor, as described in the next section.)

RELATED: Learning to Use the Registry Editor Like a Pro

Standard warning: Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.

To get started, open the Registry Editor by hitting Start and typing “regedit.” Press Enter to open Registry Editor and give it permission to make changes to your PC.

wmp_1

In the Registry Editor, use the left sidebar to navigate to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
wmp_2



On the right, find a value named LongPathsEnabled and double-click it. If you don’t see the value listed, you’ll need to create it by right-clicking the FileSystem key, choosing New > DWORD (32-bit) Value, and then naming the new value LongPathsEnabled .

wmp_3

In the value’s properties window, change the value from 0 to 1 in the “Value data” box and then click OK.

wmp_4

You can now close Registry Editor and restart your computer (or sign out of your account and sign back on). If you ever want to reverse the changes, just head back to the LongPathsEnabled value and set it from 1 back to 0.

Download Our One-Click Registry Hack
wmp_5

If you don’t feel like diving into the Registry yourself, we’ve created two downloadable registry hacks you can use. One hack removes the 260 character path limit and the other hack restores the default limit. Both are included in the following ZIP file. Double-click the one you want to use, click through the prompts, and then restart your computer.

Long Path Names Hacks

RELATED: How to Make Your Own Windows Registry Hacks

These hacks are really just the FileSystem key, stripped down to the LongPathsEnabled value we described above, and then exported to a .REG file. Running the “Remove 260 Character Path Limit” hack sets the LongPathsEnabled value to 1. Running the “Restore 260 Character Path Limit (Default)” hack sets the value back to 0.  And if you enjoy fiddling with the Registry, it’s worth taking the time to learn how to make your own Registry hacks.

Pro and Enterprise Users: Remove the 260 Character Path Limit with the Local Group Policy Editor
RELATED: Using Group Policy Editor to Tweak Your PC

If you’re using Windows 10 Pro or Enterprise, the easiest way to disable the new app install notifications is by using the Local Group Policy Editor. It’s a pretty powerful tool, so if you’ve never used it before, it’s worth taking some time to learn what it can do. Also, if you’re on a company network, do everyone a favor and check with your admin first. If your work computer is part of a domain, it’s also likely that it’s part of a domain group policy that will supersede the local group policy, anyway.

In Windows 10 Pro or Enterprise, hit Start, type gpedit.msc, and press Enter.

gp_1

In the Local Group Policy Editor, in the left-hand pane, drill down to Computer Configuration > Administrative Templates > System > Filesystem. On the right, find the “Enable win32 long paths” item and double-click it.

gp_2

In the properties window that opens, select the “Enabled” option and then click “OK.”

gp_3

You can now exit the Local Group Policy Editor and restart your computer (or sign out and back in) to allow the changes to finish. If at any time you want to reverse the changes, just follow the same procedure and set that option back to “Disabled” or “Not Configured.”

The maximum path limit may not be something you’ve ever run into, but for some people it can certainly be the occasional frustration. Windows 10 has finally added the ability to remove that limit. You just have to make a quick change to the Registry or Group Policy to make it happen.