For my application I'm testing the longest available file path to be allowed to be moved into the Recycle Bin and I'm getting interesting results.
On Windows XP the maximum size is 259 characters, which is the MAX_PATH constant minus 1.
But on my Windows 8.1 Pro, that maximum allowed file path size somehow seem to be 215 characters.
So I'm curious are there any official guidelines for this?
EDIT: OK, since posters below requested an API, I'm using SHFileOperation
with FO_DELETE
and FOF_ALLOWUNDO
to place a user's file into the Recycle Bin. Since Windows Explorer uses the same exact API for its Delete operation it's easy to test it by making a long path within Windows Explorer and then by trying to delete it. In my experiments I can see the following:
Windows XP, if the total path length is 259 chars (on some editions, it may be 257??), the file/folder will be placed into the Recycle Bin. Otherwise Windows Explorer offers only an option to permanently delete it.
Windows Vista, this limit is 217 chars, inclusively.
Windows 7 and 8, it is 215 chars, inclusively.
So it seems like this maximum limit is shrinking... Thus I was just curious, if this is documented somewhere in MSDN?