0

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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
mcfly soft
  • 11,289
  • 26
  • 98
  • 202
  • Possible duplicate of http://stackoverflow.com/questions/693076/how-to-force-delete-a-file – neo Dec 06 '13 at 17:55

2 Answers2

1

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.

Mehrdad Mirreza
  • 984
  • 12
  • 20
0

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.

ozma
  • 1,633
  • 1
  • 20
  • 28