Howto: Delete undeletable files in Windows XP

That’s right: This is for Windows. Don’t get all huffy. I learned something new today while I was at work, and I’m going to share it. Not everything has to do with Ubuntu. Okay, most everything does, but it’s only obliquely this time.

I work on a PC that has several user accounts, and some of them are quite old — outdated is a good word for them. Some of them are two or three years old, and haven’t been used in a long time. I can tell, of course, by perusing the Documents and Settings folder. (Some people really should empty their IE cache before they log out. :shock: But that’s beside the point.)

For outdated accounts for people who have since departed, I like to delete their account folder and save space on the drive (more space for music downloaded from Jamendo! :mrgreen: ). The problem is that I occasionally get mystery files that can’t be deleted. Like this …

images[1].

See that trailing dot? I don’t know if that dot is the reason, but Windows can’t delete that file. XP complains about not being able to find the file. Explorer barfs up an error message, and even DEL from a command box (dare I call it a terminal?) can’t do it. This one has the same effect.

imagrs[1].

I don’t know where they come from or why they appear, but XP has a %@#! fit every time I try to delete them. And without that file disappearing, there’s a whole trail of encapsulating folders that don’t want to delete either. Because there’s still something in there, you see. So it can’t be deleted. :roll:

So me, being Ubuntu-minded, figured it would work just as well to boot into a Linux live CD and delete it manually. Well, except that the drive is an NTFS volume, of course. And Damn Small Linux wouldn’t do NTFS for me. And Slax suddenly refused to install to a USB key for me. And now I’m spending an hour trying to work a Windows-based Slax installer program that has been discontinued and I only found by way of the Internet Archive and it doesn’t seem to like my USB drive and my download speed for the Ubuntu live CD is 10kbps on a corporate line and even then I don’t know if I could get NTFS access off a live CD and I don’t want to install the Reconstructor on a virtual PC just to get NTFS support in a live environment. …

See where I’m at? This is way too much circumnavigation just to delete a 0Kb file.

Google a little, and I came up with this.

  1. Open a cmd box. (Start > Run > cmd)
  2. Open the Task Manager. (Right-click on the taskbar.)
  3. Kill explorer.exe. Don’t close the Task Manager.
  4. Navigate in the cmd box to the undeletable file.
  5. Delete it with DEL (I used DEL *.* for an immensely gratifying delete experience).
  6. Using the File menu in Task Manager, restart explorer.exe.

And it worked. Like a charm. So let that be a lesson to you: The best solution is not always the quickest and easiest solution. Sometimes you just have to kill Explorer.

About these ads

28 thoughts on “Howto: Delete undeletable files in Windows XP

  1. Luke

    Btw, here is a nasty trick:

    1. kill explorer like you just said
    2. use the at command to schedule explorer.exe to be run in 1 minute
    3. wait
    4. watch explorer being open with SYSTEM privledges

    Congratulations – you now 0wn the box. :)

    Reply
  2. Josh

    You have no idea how badly I needed this; great pointer!

    I’ve got the exact same problem with a folder that Yahoolagins (sp? – too lazy to look it up) created in our users’ home dir. For whatever reason, they won’t delete. Resetting permissions don’t work. Taking ownership doesn’t work. I was previously stuck with no option until today. Thanks again!

    Reply
  3. Packrat1947

    Everyone should download the “Unlocker” – like PClord mentioned. After installation, it will be part of the right-click context menu in Windows Explorer. I happen to use both Explorer Plus and PowerDesk. Unlocker makes deleting stubborn files a breeze. When you choose Unlocker off the right-click, choose “unlock all”. That does it.

    Cheers,
    Packrat1947

    Reply
  4. dave

    Didn’t work for me. I have a directory that ends in a trailing dot. The directory is stored on a windows machine, but I think it was created (via a share) by a mac. Anyways – stopping explorer did not help for me. Is it because I am connected to the windows box via remote desktop?

    Reply
  5. Packrat1947

    Hi,
    Just to let everyone know – Ubuntu 7.10 live CD now has full read/write ability on ntfs. Just recently I used it to delete a very stubborn “ddccyxy.dll” file on a customer’s box.

    Moveonboot, killbox, Unlocker, and several other file delete progs. did not touch it. Even booting off a miniPE didn’t work.

    Ubuntu really didn’t delete it but moved it to a “ubuntu trash folder”. This solved my problem and the computer had to be returned asap – so I didn’t get a chance to play around any more.

    Packrat1947

    Reply
  6. Ajn

    Worked perfect! I was planning to boot in safe mode and delete but this is an easier solution. With explorer stopped, is there any other file navigation tool or software to use? I mean an alternative to step6.

    Reply
  7. ray

    hi, good pointers. i had same issue on my xp box. all i did was share the directory and use samba on my linux box to navigate to mount the share then delete away. worked just fine. nice website btw :)

    Reply
  8. Ewan

    Thank you! I normally use a proper operating system but I had to get rid of old Microsoft Office (would you believe it?) files that wouldn’t delete. Finally by killing explorer Windows let me delete files on the computer which I own. Who’d have thunk that the computer would tell the owner what to do eh?

    Reply
  9. bobwalruss

    Thanks a million! after losing a lot of sweat, this worked so easily! Had to refresh my memory though on how to navigate and delete in command prompt.

    Reply
  10. lee

    how can when i log in CMD it only come out C:documnet and settings \ Owner>
    but soemthings i wanna delete is in F: and it didn’t show on the screen .help me please !

    Reply
    1. pcgeeksince84

      Change to the drive letter via by typing “F:” with out the quotes at the “C:\>documents and Settings\Owner>” or get a Command for dummies book and learn the basic 101s of MS Command . Your lucky you weren’t playing with PCs in the 80s. You would be what they call a ID-10-T error.

      Reply
  11. Sion

    yeah, thats sooo weird! I found a file like this, and I just couldnt delete it either…naturally, I went straight to cygwin to nuke it…but that didnt work…so I thought before I boot knoppix, and smackdown, I will google for wisdom…and you were right, I just went to dos and used DEL ?! this is a hangover from dos 3.1 why this works I can only imagine is a mistake, but it did it…many thanks!

    Reply
  12. Jenny

    I got up to step 3.. XD But when I’m in the box, I don’t know how to navigate to the file. Can someone tell me specifically what to type in if my undeletable file is on my desktop? And also what do you type when you delete it? Thank you very much. :D

    Reply
    1. K.Mandla Post author

      It’s been a long time since I did this, but I believe if you use the command box to move to your user folder, there should be a Desktop folder inside there. Sorry I can’t be of more help; perhaps another Windows user can chime in and help find that. :|

      Reply
  13. Jenny

    Ahh, I’ve got it. Thank you so much! :D I feel better. It was annoying the hell out of me. :T

    Reply
  14. ty

    hi, thank you.
    Didn’t work instantly,

    my annoying file was named 04.avi.
    cmd complained about not finding such a file, but with
    del *.
    it worked llike a charm!

    Reply
  15. Snark

    Brilliant sir. I’m embarrassed that I didn’t know this trick already! Thank you… I’ve added this trick to my toolbox.

    Reply
  16. Prashant

    That really worked…quick and easy trick..deleted a couple of stubborn files that were just not getting deleted for several days..Thanx..

    Reply
  17. Tony Terry

    Thanks for that – I’ve struggled to get rid of a folder that ended with”.” for ages. Your tip and the use of “rd folder /s” sorted it, Thanks a lot.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s