P
pjohnst0n
hi,
can anyone tell me the max length you can have for filename in XP?
(incl. path)
cheers
can anyone tell me the max length you can have for filename in XP?
(incl. path)
cheers
hi,
can anyone tell me the max length you can have for filename in XP?
(incl. path)
hi,
can anyone tell me the max length you can have for filename in XP?
(incl. path)
cheers
David H. Lipman said:From: "Wesley Vogel said:The PATH counts also.
Here's some info.
File names in XP can have up to 255 characters.
Most PROGRAMS only recognize a PATH length of around 256 characters.
The path can only have 260 characters. A path is structured as follows:
drive letter, colon, backslash, components separated by backslashes, and
a null-terminating character. For example, the maximum path on the D
drive is D:\<256 chars>NUL.
[[Win32 programs are limited to a 256-character string size limit
because of the MAX_PATH variable. Software programs can work around this
problem by passing Win32 a path that is MAX_PATH or less. The real
underlying path can then be accessed independently of the real length of
the path. In this way, a program can access files or directories beyond
MAX_PATH on the server. ]] Path Too Long Error Message When Exceeding
MAX_PATH http://support.microsoft.com/kb/177665
I just named a txt file with this name...
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat.txt
That is the maximum number of characters that I could get, around 190.
Windows would not let me type any more characters.
This is the actual path to the file...
C:\Documents and Settings\Wesley P. Vogel\Desktop\New Folder(2)\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat.txt
190 characters in the name.
3 characters in the extension.
14 characters in New Folder (2)
15 characters in Wesley P. Vogel
22 characters in Documents and Settings
----------
About 244 characters total. It's possible that I may have miscounted.
Close enough for the girls that we go with. ;-)
I tried to drag that 190 character file to this folder...
C:\Documents and Settings\Wesley P. Vogel\My Documents\My Download
Files\Batch Files\advanced\DISK
This is the exact error message that I got...
---------------------------
Error Moving File or Folder
---------------------------
Cannot move
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat: The file name you specified is
not valid or too long.
Specify a different file name.
---------------------------
OK
---------------------------
When I went to delete New Folder (2), I got this error:
---------------------------
Confirm File Delete
---------------------------
The folder 'New Folder (2)' contains items whose name is too long for
the Recycle Bin.
Do you want to permanently delete it?
---------------------------
Yes Yes to All No Cancel
---------------------------
So I clicked on Cancel.
I opened New Folder (2).
I renamed that 190_character-named.txt file to at.txt.
I then was able to delete the New Folder (2).
A way to get around the problem is to use the SUBST.EXE command such as...
subst P: "C:\Documents and Settings\Wesley P. Vogel\Desktop\New
Folder(2)"
Thus you can manipulate the long file named file in "P:" because its path
has been effectively been shortened.
From: "Wesley Vogel" <[email protected]>
| Thanks for the tip, but I only tried that once and kept the notes because I
| was curious. ;-) I don't really have any need for filename that long.
|
I run into this every so often with my Domain users. They create long filenames in deep
folders with long names and they "dig them selves into a hole". Using the SUBST.EXE command
allows me or the user to substitute to some folder and then flatten the tree thus reducing
the total length. Otherwise the path they see is too long and they get errors trying to
manipulate the files.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.