Unable to Delete Files -- File Name Too Long

Anonymous
2010-05-01T23:10:08+00:00

I copied all of the files under C:\Users<userid> to a backup drive (NTFS).  I then tried to delete the Temporary Internet Files folder.  I go an error message saying:

The file name(s) would be too long for the destination folder.  You can shorten the file name and try again, or try a location that has a shorter path.

When I drilled down to where the problem files were I saw a bunch of files with very long names.  I right clicked on one (hoping to rename it) and the only options available were: Open, Pin to Start Menu, Send to.  Delete, Rename and Properties were missing.

How do I get rid of these files without having to reformat the drive?

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-05-03T07:03:50+00:00

For those that hit the same problem the solution was to open the folder in a cmd window and list the short names of the files.  Then use the short names with the Erase command.

Was this answer helpful?

100+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2010-05-02T00:13:20+00:00

Hi,

Try Disk Cleanup = Start - All Programs - Accessories - System Tools - Disk Cleanup


You may also need to run checkdisk

How to Run Disk Check in Windows 7

http://www.sevenforums.com/tutorials/433-disk-check.html

======================

If needed :

DO NOT INSTALL THE eBay Option with UnLocker (uncheck it in the installer) andthen go into UnLocker Folder in Program Files - UnLocker and DELETE the ebayxxx.exe file - you can easily see it."C:\Program Files\Unlocker"  just the ebayxxxx.exe I forget its name exactly.

Author's site shows it as Vista/Windows 7 supported now :

http://www.emptyloop.com/unlocker/ 

UnLocker 1.92

http://www.softpedia.com/get/System/System-Miscellaneous/Unlocker.shtml <-- or Download UnLocker here ****

Download - SAVE - go to where you put it - Right Click on - RUN AS ADMIN

The below also works on 32 and 64 bit Vista/Win 7 and should work on Win 8/8.1.

Another good alternative - Use FileAssassin :

FileAssassin - Free

http://www.malwarebytes.org/fileassassin.php

Force Delete (Cannot Delete) Locked or In Used Files or Folders with FileASSASSIN

http://www.mydigitallife.info/2008/12/27/force-delete-cannot-delete-locked-or-in-used-files-or-folders-with-fileassassin/

Download - SAVE - go to where you put it - Right Click on - RUN AS ADMIN

And this - MoveOnBoot

MoveOnBoot

http://www.softwarepatch.com/software/moveonboot.html

Hope this helps.


Rob Brown - MS MVP - Windows Desktop Experience : Bicycle - Mark Twain said it right.

Was this answer helpful?

20+ people found this answer helpful.
0 comments No comments

84 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-12-15T13:15:17+00:00

    Hi,

    I am wondering why everyone is recommending all these "wonderful" third party solutions when a utility that ships with windows can do the trick.

    the robocopy command - available from the command prompt - has a purge sub-command that recursively deletes and files it finds in a target folder that were not present in a source folder. Hence a robocopy purge from an empty folder to a full folder will delete EVERYTHING in the full folder.

    Create a new folder "c:\temp\empty"

    if path for said file with long name is "q:\stubborn\folder\abcdefghijk12345678900-98765332.txt"

    the following command line entry should remove the file

    robocopy c:\temp\empty q:\stubborn\folder /purge

    if the issue is a long folder name, and the folder name is q:\stubborn\folder-verylonguuyroyrlylbb

    the following should remove the folder:

    robocopy c:\temp\empty q:\stubborn /purge.

    Hope this helps someone out there as i found all the 3rd party tools a bit disturbing!!

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2012-07-20T19:23:53+00:00

    Open a dos prompt, cd to the directory tree in question and try

    FOR /F "tokens=*" %G IN ('DIR /B /AD /S *') DO RMDIR /S /Q "%G"

    Make DARN sure you you are in the right directory tree as it might cause all kinds of pain.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2012-03-24T23:38:22+00:00

    No it did not help

    None of the listed programs (fileAssassin or MoveOnBoot)  can even see the files.

    Installing them was a waste of time

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments