Erase file with too long file name

Status
Not open for further replies.

lopdog

Posts: 275   +1
Hi, I have a file that I cannot delete, rename or move, because Windows says it's name is too long or the path is to long (not supported by the file system). The dialog box tells me to rename the file, or move it to another location, but none of this is posible. How can I get rid of this file? (And how is it even posible that the AutoCAD installer and Windows creates a file that the file system cannot handle?)
 
move all content (except the problem file) in the folder
backup to the parent folder

delete the subfolder with the sole problem file in it.
 
NTFS Directory depth limit

There is no official published NTFS file specification...however, under NTFS the directory depth is limited by the 255 character file name limit; directory depth cannot be more that.
This means
a) one directory & file name pair can be <=255 characters in length
b) NN directory names (or a 'path' ) + the longest filename in the last subdir can be <= 255 characters

I beleive that the '\' path separator is added(or included) to the the total length.
 
You can delete it from command prompt.
1) Windows -> Run -> type cmd.exe and hit enter
2) Navigate to the folder you are after using the "cd" command. E.g. if the directory is:
c:\this\is\my\folder\path,
you would type
cd /d c:\this\is\my\folder\path and hit enter.
Note. the /d means also change current drive as well if applicable so this command works if you have multiple hard drives.
3) Delete the file by using it's 8 letter dos name. If the file is named SOMEREALLYBIGFILENAME.EXT, the trick is pick the first 6 letters then add "~1" and then the extension.
So type "del SOMERE~1.EXT" and hit enter. It should confirm the deletion was successful.
 
Thanks for all the suggestions.


This is the famous file. It was created by Autodesk AutoCAD, and I don't think it's a virus (unable to scan, no actions is possible with this file). I copied the entire "Application Data" folder from a computer running Windows XP to my external usb hdd, and now I have erased everything again, except this file. Deleting the file using its 8 letter DOS name did not work either. I also tried to use chkdsk, but it found nothing.
 
OK, I found a solution: I renamed all the parent directories to "1", (eg. C:\1\1\1\1\1\1\1\... etc). That way the file path and name was short enough to erase the file.
 
Easiest way is to open WINRAR archiving software. Navigate to trouble causing files 'folder', right click it and rename it to '1'. If it renames you can then right click and delete.
 
HAI!! the "1" file name worked I'd grabed a wallpaper archive from konachan and I could not delete the folder renamed both folders to "1" and it worked, heck even ccleaner couldn't delete it neither, but I got it done so thanks y'all
 
I found a so simple way to do it, it really pissed me off, Cut, Paste in recycle bin, empty recycle bin, I had 7 files with over 260 characters long,
lol..I just cut and pasted it like you said and Voila! I did have to make one more step, move from "Music" to "Public Music" folder to do it though. Great suggestion! :O)
 
Status
Not open for further replies.
Back