Through some wget scripts, I managed to create some files with very long names and special characters. Now, I am unable to rename/delete them. In-fact windows is behaving wierdly with them (nothing new I agree):

1) My Norton Antivirus Scan automatically stops and closes on encountering these files .. very dangerous :(.

2) The files are shown in the directory view as any other file. But, right clicking on them does not bring up the usual menu (which has open/delete, rename, properties among other options). The menu that comes only has "Open" and "Send to" in them.

The filesystem is NTFS (externally mounted Hard drive).

I have lived with this for months but now I am uncomfortable with those files lying around and hope someone will be able to suggest a fix.

NOTES:

1) I have tried using quotes " on the command prompt. But still can't execute the rename or del command. The error I get is "The filename or extension is too long".

2) Sample dir /x output (The columns like the one with MA27C5~1.KEY entry are making me further nervous. What does that mean? Not all files have that kind of entry.):

01-Apr-10  15:30            10,177              main.php?g2_view=search.SearchScan&g2_form[useDefaultSettings]=1&g2_return=%2Fgall
ery2%2Fmain.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=The+Education+of+Charlie+Banks&g2_returnName=keyword+album
01-Apr-10  15:20            10,177              main.php?g2_view=search.SearchScan&g2_form[useDefaultSettings]=1&g2_return=%2Fgall
ery2%2Fmain.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=The+Haunting+in+Connecticut&g2_returnName=keyword+album
01-Apr-10  14:58            10,177              main.php?g2_view=search.SearchScan&g2_form[useDefaultSettings]=1&g2_return=%2Fgall
ery2%2Fmain.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=X-Men+Origins%3A+Wolverine&g2_returnName=keyword+album
26-Mar-10  15:29            10,177 MA27C5~1.KEY main.php@g2_view=search.SearchScan&g2_form@5BuseDefaultSettings@5D=1&g2_return=@2F
gallery2@2Fmain.php@3Fg2_view@3Dkeyalbum.KeywordAlbum@26g2_keyword@3Dyour@2Bperfect@2Bfit&g2_returnName=keyword+album
link|improve this question
feedback

5 Answers

Try Unlocker you can remove any file. it will take care of:

  • Close handle

  • Kill process

  • Unload DLL

  • Delete index.dat

  • Delete/Rename/Move

  • Invalid Names

and its FREE!

link|improve this answer
This is what I was going to suggest... – martineau Dec 15 '10 at 10:27
@martineau: will it means that we are friends of same guy :) – Omeid Herat Dec 15 '10 at 13:17
Tried Unlocker. Didn't help. On deleting the file, it says "filename, directory name, or volume label syntax is incorrect". – JP19 Dec 27 '10 at 11:30
feedback

You may be able to do into safe mode and delete it using its ~ name.

  1. Boot in safe mode
  2. dir /x (this should display the ~ name)
  3. del file using the ~ name
link|improve this answer
This has worked before for me with some funny japenese characters on images I pulled out of a wallpaper .zip collection. – Ape-inago Mar 25 '11 at 7:29
feedback

Try clicking on the file and pressing F2, then rename it... if it works, you should be able to delete it...

link|improve this answer
Clicking F2 on the file doesn't bring up anything (on other 'normal' files in the same directory, it works). – JP19 Dec 15 '10 at 9:43
I mean press... :) Click on the icon of the file, press F2, then rename it... :) – Owen Dec 15 '10 at 9:49
Yes, thats what I did :). Clicked on the icon to select it, and then pressed F2. [wonder what I was thinking when I wrote "clicking F2" :p]. – JP19 Dec 15 '10 at 9:59
feedback

Empty the directory of all files except the bad ones, backup the HDD but exclude the directory containing those files, reformat and restore.

link|improve this answer
feedback

You may be able to delete them using an ubuntu live cd, but make sure you run a chkdsk in windows first otherwise it will complain that the ntfs partition is messed up.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown