I'm on Windows Server 2008 64-bit. LockHunter identifies that a folder is locked by the "System" process. I'm not sure why this happens, but my bigger concern is how to unlock it. I'm looking for a solution that can be run from the command line.

LockHunter itself is unable to unlock it. Also, Sysinternals' Process Explorer doesn't find the locked folder's handle. Rebooting is not an option either.

alt text

  • This guy shares your view. scatteredideas.info/archives/delete-locked-files-32-and-64-bit
    – Nissan Fan
    Oct 7, 2009 at 16:30
  • Have you looked at this question: How do I delete a ‘locked’ file in Vista 64?
    – nik
    Oct 7, 2009 at 16:35
  • It's not just any file, it's a file locked by System that's giving me the problem. I didn't have problems unlocking other files.
    – ripper234
    Oct 7, 2009 at 18:55
  • For repeated occurrences where you can't track what's creating the file, try running ProcMon from the SysInternals suite, filtering down on a suitable Path and remembering to include the System process in the filter (which is excluded by default). As you might need to leave it open for a while, choose Drop Filtered Events from the Filter menu. When the file is touched you should see a CreateFile event. Opening up that event might reveal an "Impersonating" field with an associated username -- sometimes that might be enough of a clue to move you on. Mar 12, 2015 at 12:36

8 Answers 8


It turns out this was caused by another computer that had an open explorer shell on the "problematic" computer. This problem persisted even after a reboot! (not at first, but it reappeared)

The only solution was to close the relevant explorer window from the other computer.

  • 2
    In my case my collegue created herself a shortcut for exe in shared folder and just used to launch it directly from network share. Feb 8, 2013 at 11:09

usually it is because the file is open via file sharing. You can close that in computer management GUI / Shared folders / Open Files or via command line

net file - lists all open files

net file id /close

UPDATE: this command might work better in some cases:

openfiles /query /fo csv /v > c:\temp\files.csv -then open files.csv and search in it-

  • Nice. Worked perfectly for my situation. Sep 27, 2018 at 12:45

If nothing else works, you may need to schedule an outage to reboot into safe mode and delete the file.


I don't think you can unlock any file locked by System.

Some utilities will only schedule deletes and renames for boot-time, as answered here already.

You might prefer to solve the causes for such locks, by searching using Process Explorer for the locking process. Once you know which system process it is, you may be able to disable it. For example, an always good candidate is Microsoft Search.


If Process Explorer doesn't find the locking process, try EMCO UnLock IT, said to work on "Windows Vista and various x64 platforms".

  • 2
    Process Explorer finds no locking process.
    – ripper234
    Oct 7, 2009 at 16:47
  • I edited in another possibility.
    – harrymc
    Oct 7, 2009 at 17:32
  • @ripper234 I've had situations where process explorer finids that a folder is locked by system pid4, but then that doesn't help much 'cos it doesn't show what service is locking it.
    – barlop
    Jan 18, 2019 at 19:36

Rebooting is sometimes all you need to do; if you haven't tried that yet, do so. If it's still locked when the system comes back online, then you can use a schedule-delete-for-boot utility.


Logging other users off the server ended up releasing the lock for me.


In my case, the fix was to check in Computer Management -> Shared Folders->Open Files who is locking those files and then end the session for them.

Hope it helps !


Safe mode command window worked for me. Be sure to have your local admin password and Bitlocker key before proceeding.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.