Link to home
Start Free TrialLog in
Avatar of RichNH
RichNH

asked on

Delete locked file that nobody is accessing

I have an MSAccess LDB file which when I try to delete it says it is locked by another user but which I know nobody else is accessing.  How can I delete this file?  It is located on a file server running under Win 2000 Server
Avatar of puppydogbuddy
puppydogbuddy

Reboot eindows and then try and delete.
Ps: The above assumes you first shut down ms access and could not delete the ldb.
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RichNH

ASKER

Thanks guys, I'll try that the first chance I get, perhaps I can come in this Sunday and give it a shot.  Usually there's nobody here then.  I'll let you know.
Something has a handle to the file and thus you can't delete it.  Instead of blindly rebooting the server to fix a problem, you can find out what process has the handle, and then kill the handle and you can do all this without rebooting.

Grab handle from here: http://www.microsoft.com/technet/sysinternals/utilities/handle.mspx

Once you find the handle that has it open, you can close it with the command, or you can use process explorer to do it via gui:

http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx

With process explorer, load it and select view, Lower Pane View, Handles

Then select the process that handle.exe found and you can release the handle by right clicking the LDB file below and selecting Close Handle.

Or you can just click though the process one by one and look at the File handles.  Then select your LDB file when you find it and close the handle.

Once the handle is gone, you can delete the file.

This way you have a better chance of finding what is actually causing the problem.  Could be antivirus, or a defrag util, etc.  
<<Something has a handle to the file and thus you can't delete it. >>

   A somewhat simpler technique is to right click on My Computer, Select manage.  Go to Shared Folders, then open files.  Right click on the correct open file and then select close.

JimD
Jettman,

That list is network session based and if the network session is closed, the open files will not show it.  I find that method hit and miss, 99% miss.

Also if something is accessing it locally (like Antivirus or a local user), it will never show up in that list.

<<That list is network session based and if the network session is closed, the open files will not show it. >>

  Yes, I should have mentioned that.  I generally go there first because it's simpler to do and most often, it's a network user that has the file locked.

JimD
Yes I agree.  I failed to mention that since it usually isn't our issue and we usually end up with the process explorer method to release that handle.