How to delete a locked file in Windows?
Sometimes when you try to delete a file on Windows it says file cannot be delete as it is used by another program; you must close the program to delete the file. Well, almost all the time you actually know which program to close in order to delete the file (also rename the file). But today when I tried to delete a file (which was not open in any program nor did I use this file for over three months) Windows was showing the message. You cannot really say which program or process is using it. So I downloaded Process Explorer from Microsoft’s site which you can use to see which process or program is using the file you are trying to delete.
After you run the Process Explorer go to “Find” menu and click on “Find Handle or DLL …” (Ctrl+F). Type in the file name (full or partial) you are having trouble deleting or renaming and hit Search. Process Explorer will list all the processes or programs using this file. When I searched for the file I was having problem with it showed that the “Explorer” is using it! So what can I do in that case?
From “Task Manager” if I kill the “Explorer” process I cannot browse to the folder so using “Task Manager” I ran “Command Prompt” and from command line I changed directory to the desired location. Typed the command to delete the file “del filename.ext”. I was able to delete the file and then using “Task Manager” I started “Explorer” again. It was easy but “Process Manager” made it easy to find the process. So many hidden stuff that we have on Windows!
![[del.icio.us]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/facebook.png)
![[Feed Me Links]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/feedmelinks.png)
![[Google]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/google.png)
![[LinkedIn]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/linkedin.png)
![[StumbleUpon]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/technorati.png)
![[Twitter]](http://ehsan.bdwebwork.com/wp-content/plugins/bookmarkify/twitter.png)


