Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I occasionally unzip files and have to rename the folder to a single letter before trying to delete it. The reason is that the full path & file name is too long. Is there a registry setting or anything that I can do to have Windows ignore the warning and just delete the file?

"Cannot delete.... The file name you specified is not valid or too long. Specify a different file name."

boost also did not delete the file when I tried using it, but maybe I had a syntax error?
Posted

1 solution

That was a common problem in the dinosaur age. Starting Win2K (?) the path+file length have been increased to 32K. Unless you have very deep directory structure you should never run to this issue. About 10 years back we did a testing to see how deep we can go using 3 char folder names and we went more than 100 folders deep.

See here for Naming Files, Paths, and Namespaces[^]

Since you are dealing with zipped files, you issue may be with file names. Check for the file you are trying to delete. Does it have any extension? how are you trying to delete it?
 
Share this answer
 
Comments
T2102 28-Jan-11 0:50am    
Interesting. I am no way near 100 folders deep; more like 4 to 6. Based on the article you sent, it appears that the problem is that the maximum path length is 260 characters. When I unzip to a new folder, the maximum path length may be exceeded. So I think I can avoid the file by unzipping to here and not to a new folder.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900