Windows 7: File In Use when deleting file

8

Possible Duplicate:
How do I delete a 'locked' file?

Trying to delete a file, and I get an error saying that the file is in use. I've tried to look for it in the Resource Monitor (Disk), but cannot find it there.

Is there a way I can see what is holding on to a certain file (or folder) in Windows 7? Like, is there a built-in tool somewhere? I know in linux there is a command called lsof. Anything similar in Windows 7?

If not anything built-in, is there a anything I can use?

Svish

Posted 2009-11-20T19:52:45.933

Reputation: 27 731

Question was closed 2012-06-11T11:43:51.617

Answers

9

LockHunter can be a solution, it's freeware and works like Unlocker, which is another nice tool.

buba

Posted 2009-11-20T19:52:45.933

Reputation: 458

1Seems to be working. Have been using Unlocker before. – Svish – 2010-02-27T11:30:59.197

4

I use the 'Find Handle or dll' option in Process Explorer

sgmoore

Posted 2009-11-20T19:52:45.933

Reputation: 5 961

Press Ctrl+F and type part of the name – AaronLS – 2014-07-02T02:12:13.240

0

Open an administrator command prompt by typing cmd into the start menu search box, and hit the Ctrl+Shift+Enter key combination.

alt text

To take ownership of the file, you’ll need to use the takeown command. Here’s an example:

takeown /f C:\Windows\System32\en-US\winload.exe.mui

That will give you ownership of the file, but you still have no rights to delete it. Now you can run the cacls command to give yourself full control rights to the file:

cacls C:\Windows\System32\en-US\winload.exe.mui /G geek:F

(e.g) Note that my username is geek, so you will substitute your username there.

At this point, you should be able to delete the file. If you still can’t do so, you may need to reboot into Safe Mode and try it again. For the filename in the example, I was able to overwrite it without safe mode, but your mileage may vary.

(source)

joe

Posted 2009-11-20T19:52:45.933

Reputation: 11 615

Good stuff, but that won't really help when the file is in use though, will it? – Svish – 2009-11-21T17:36:54.513

find the file in safemode and delete it. (in safe mode nothing in startup is ran so you can find the file and delete it.) – mike – 2009-11-24T06:59:07.270

-1

  1. Goto Start;
  2. Click 'Run';
  3. Type 'CMD (Windows XP), COMMAND (Other Window OS).;
  4. Hit 'Ok'
  5. At this point you should see something like: C:> on the left hand of the window.
  6. Type 'Del see below;
  7. Hit 'Enter';
  8. Type 'exit'

is the .exe's name, now if its saying in use, im not sure what you can do in that sitiution, i believe yo

joe

Posted 2009-11-20T19:52:45.933

Reputation: 11 615

This is not a solution, and likely going to give same result as feedback via GUI on not being able to delete the file. – user66001 – 2013-02-15T20:50:58.053