Saturday, May 18, 2013

How to Delete an Undeletable or Locked File

How to Delete an Undeletable or Locked File

Have you ever run into a situation where you wanted to delete a file, but Windows simply wouldn’t allow you to do it? Personally, these things happen to me all the time, especially when I’m at a client’s house trying to get their machine clean of malware. Have you ever tried deleting a locked file using common windows commands? If so, then you’ll know that this is just not possible.

The main reason behind this is that the explorer.exe process locks files that are in use, effectively preventing you from deleting them. Usually, these files should not be touched, but sometimes, situations arise when you really need to erase some troublesome ones.
Fortunately, there are a few easy solutions to delete those files.
Solution #1: Kill explorer.exe ( This worked for me)
·         Open a command prompt
·         Navigate to the location where the locked file is
·         Press CTRL-ALT-DEL, click on “task manager”, select the Processes tab
·         Kill the explorer.exe process via the “End Process” button
·         Go back to the command prompt and delete the file
·         Bring up the task manager windows again
·         Select file->new task
·         Type explorer.exe in the “create new task” field
·         Press OK.
Solution #2: Use The Windows Recovery Console
Just stick your Windows CD in your CD tray, boot on it, and at the “Welcome to Setup” screen, press “R“. Once the recovery console has started, navigate to the location of your locked file, and delete it. Since WRC does not really start the system, the files will not be in use, and you will be able to delete them. Oh, and for all you Linux geeks out there, yes, we know, doing this via a Linux live CD / USB key is also possible.

No comments:

Post a Comment