also @ TechSpot: 'Supercapacitor' could fully charge your phone in less than 30 seconds

Erase file with too long file name

Discussion in 'Windows OS' started by lopdog, Apr 15, 2011.

Post New Reply
  1. lopdog TechSpot Maniac Posts: 378

    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?)
  2. Tmagic650 TS Ambassador Posts: 18,729   +62

    Your PC may be infected with a virus or other malware
  3. gbhall TechSpot Chancellor Posts: 2,069   +15

    as well as virus checkig, also run chkdsk
  4. SNGX1275 TS Special Forces Posts: 11,891   +117

    You could try and run a program like Eraser, you may have to tell it to delete on reboot.
  5. jobeard TS Ambassador Posts: 12,210   +118

    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.
  6. jobeard TS Ambassador Posts: 12,210   +118

    NTFS Directory depth limit

    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.
     
  7. Darth Shiv TechSpot Maniac Posts: 686   +49

    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.
  8. lopdog TechSpot Maniac Posts: 378

    Thanks for all the suggestions.
    [IMG]

    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.
  9. lopdog TechSpot Maniac Posts: 378

    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.
  10. jobeard TS Ambassador Posts: 12,210   +118

    well done - - thanks for the feedback :)
  11. LNCPapa TS Special Forces Posts: 3,946   +120

    That must've been one heck of a jpg.
    ravisunny2 likes this.