mcfly soft
mcfly soft

Reputation: 11665

How to delete a file even if it is locked in windows 7?

I need to delete a file programmatically even if the file is locked. I get a locked state and I can't figure out, which process it locks. It is no system file, but my own created file. It is still locked, after closing all my applications.

How?

Upvotes: 0

Views: 197

Answers (2)

Mehrdad Mirreza
Mehrdad Mirreza

Reputation: 1082

If the "Process Explorer method" didn't help, try:

  1. remember the path, kill "Windows Explorer", delete in CMD console, and restart Explorer
  2. Use ForceDel (https://github.com/michaelknigge/forcedel)
  3. Use UnlockIt (http://emcosoftware.com/unlock-it)

If none of them works, you'll probabely not be able to delete the file/folder. You can then use LockHunter (http://lockhunter.com/) to automatically delete it after reboot.

Upvotes: 1

ozma
ozma

Reputation: 1803

You can use "process explorer" to find the process that locks it.

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Open process explorer click the binocular icon and search the file name.

Upvotes: 0

Related Questions