Limit on the length of characters in file location & name

jmt356
SilverLounger
Posts: 2370
Joined: 28 Mar 2010, 01:49

Limit on the length of characters in file location & name

Post by jmt356 »

Is there a way to remove the character limit on the length of characters in a file location and file name in Windows 8?
Regards,

JMT

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Limit on the length of characters in file location & nam

Post by HansV »

No.
Best wishes,
Hans

jmt356
SilverLounger
Posts: 2370
Joined: 28 Mar 2010, 01:49

Re: Limit on the length of characters in file location & nam

Post by jmt356 »

How about in Windows 8.1 or later versions of Windows?
Regards,

JMT

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Limit on the length of characters in file location & nam

Post by HansV »

No. The MAX_PATH constant is deeply embedded in the Windows API.

There is a way to use longer paths (up to about 32,767 characters), by specifying it in the form

\\?\C:\very long path

but many programs won't be able to handle such paths, so it's better to avoid them.

See Naming Files, Paths, and Namespaces if you're interested in the technical details.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Limit on the length of characters in file location & nam

Post by Rudi »

Another piece of info with additional advice; though practically I'd not want to go this route at all...
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Limit on the length of characters in file location & nam

Post by HansV »

As that article mentions, while it is possible to create files whose total path+filename is longer than 255 characters, but you probably won't be able to do anything with them since Windows Explorer/File Explorer (which also provides the Open and Save As dialogs to applications) doesn't handle such files.

So for all practical purposes, the answer remains No.
Best wishes,
Hans

User avatar
DaveA
GoldLounger
Posts: 2599
Joined: 24 Jan 2010, 15:26
Location: Olympia, WA

Re: Limit on the length of characters in file location & nam

Post by DaveA »

Also note that a CD or DVD have the limit of 124 characters!
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

jmt356
SilverLounger
Posts: 2370
Joined: 28 Mar 2010, 01:49

Re: Limit on the length of characters in file location & nam

Post by jmt356 »

I find it unusual that in our advanced age, Windows is still limiting the number of characters for a file name and path to 255 characters. Consider, for example, that navigating just up to the Documents folder alone takes up 39 characters, more than 15% of the 255-character allocation, if the user name is 6 digits:
C:\Users\[6-digit user name]\Documents\

That only leaves 216 character, which easily gets eaten up by folder and subfolder names before even reaching the file name.
Regards,

JMT

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Limit on the length of characters in file location & nam

Post by ChrisGreaves »

jmt356 wrote:I find it unusual that in our advanced age, Windows is still limiting the number of characters for a file name and path...
I'm with you on this.
It took me years to drop the 8.3 habit (and that came with difficulty after my ICL1900-series 5-char names!) and now I am comfortable with descriptive paths.

But.

When I go to save a web page (from Firefox) in "T:\Greaves\Admin\Domains\Tripping\Europe\IleDeFrance\Melun\" and the web page's external name is "Réseau MELIBUS horaire bus, info trafic - Melun Val de Seine_files" and that FOLDER has files and folders, I am, in a fashion, screwed.

Mapping with a SUBST command as in "subst W: "%Drive%\Greaves\Admin\Domains"" is no solution because ultimately something (in my case RoboCopy for backup) needs to know the complete name.
And then something croaks.

I don't have an answer; condensing long names just adds another layer between what's visible to the user and the slave mechanism for locating files.

:sad: :scratch:
An expensive day out: Wallet and Grimace

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Limit on the length of characters in file location & nam

Post by HansV »

Despite what Chris writes, assigning a drive letter to a folder path will solve the problem for most purposes.
Best wishes,
Hans