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.
Unable to Delete Files -- File Name Too Long
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.
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
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.
84 additional answers
Sort by: Oldest
-
Anonymous
2014-11-17T16:00:48+00:00 If you want to get rid of these files with out a lot of fuss. Just use your copy of WinRAR to archive and make sure to check the delete files when done. Now you have a *.rar of your locked files that can be deleted just by using the shift+Del method.
Absolutely brilliant! Thank you for this tip - it was the only one that worked in Windows 8.1. I had this nasty file from svn that nothing would delete, and the WinRAR trick did the job. Thank you!
-
Anonymous
2014-11-24T21:17:23+00:00 Here is a step-by-step procedure that worked for me. This will delete all files in the target directory including files with long file names.
- Open windows explorer and navigate to the folder that contains the long file names you want to delete.
- Copy the path of the folder to your clipboard.
- Run cmd.exe
- type in the drive that the offending folder is located on. ie. "h:" and press <enter>
- type "cd " and right click and select "paste" to paste the path of the folder you want to delete files from and press <enter>
- type "del *.*" and press <enter>
- You should now have an empty folder. You can verify this by typing "dir" and pressing <enter>
This procedure works great for deleting backup copies from an external hard drive when you get the Windows error about having too long file names during delete.
-
Anonymous
2014-12-26T19:21:23+00:00 The easiest way to deal with this is to rename the folder/file names until the path/filenames are short enough for Windows to handle. The folder/file can then be deleted in the usual way.
Worked! When earlier suggestions in this thread did not.