T

How to Find Which Process Is Locking a File or Folder in Windows

34 views · updated 2026-07-01 · published 2026-07-01 · by Hasarinda Manjula · Microsoft Windows Reading time: 3 min English සිංහල

Overview

When Windows says a file is "open in another program" and you cannot edit, move, or delete it, something is holding a lock on it. This guide shows how to find exactly which process is using the file and release it, using Process Explorer, Resource Monitor, the command line, or a dedicated tool.

Find and release the process locking a file so you can modify it.

Key Takeaways

  • A locked file is held open by a running process.
  • Process Explorer’s Find Handle feature pinpoints the exact process.
  • Resource Monitor can find and end the process from its handle search.
  • Close the owning process (or the handle) to release the lock.

Method 1 — Sysinternals Process Explorer

1. Download Process Explorer from Microsoft Sysinternals (official) and run it as administrator.

2. Press Ctrl + F (Find > Find Handle or DLL).

3. Type part of the file or folder name and click Search.

4. Select the result to highlight the owning process; right-click the handle and choose Close Handle, or end the process.

Method 2 — Resource Monitor

1. Press Windows key + R, type resmon, and press Enter.

2. Open the CPU tab and expand Associated Handles.

3. Type the file name in the search box to see which process holds it.

4. Right-click that process and choose End Process to release the lock.

Method 3 — Command Line

1. Enable handle tracking: open Command Prompt as administrator and run openfiles /local on (then restart once).

2. List open files: openfiles /query

3. Find your file in the list and note the process, then end it with taskkill.

4. Alternatively, use the Sysinternals "handle" command-line tool: handle filename

Method 4 — Third-Party Tools

  • LockHunter — shows what is locking a file and can unlock or delete it.
  • These tools add a right-click "What is locking this file?" option for convenience.
  • Use reputable tools downloaded from their official sites.

Warning: Ending the wrong process can cause data loss in that app. Save your work elsewhere first, and avoid force-closing critical system processes.

Troubleshooting

Problem: The file is locked by a system process.

Solution: It may be in use by Windows (e.g. indexing or antivirus). Try again later, disable the relevant feature temporarily, or delete the file in Safe Mode.

Problem: Closing the handle did not help.

Solution: End the owning process instead of just the handle, then retry your action.

Problem: openfiles shows nothing.

Solution: Enable it first with openfiles /local on and restart, since handle tracking is off by default.

Problem: You cannot delete the file at all.

Solution: Boot into Safe Mode (fewer processes run) and delete it there, or use a tool like LockHunter.

Conclusion

Process Explorer and Resource Monitor make it easy to discover exactly what is locking a file and release it. Identify the process, close the handle or end the app, and your file is free to edit, move, or delete.

</w:pBdr><w:spacing w:before="220" w:after="40"/></w:pPr><w:r><w:rPr><w:b/><w:bCs/><w:color w:val="0B5394"/><w:sz w:val="21"/><w:szCs w:val="21"/><w:rFonts w:ascii="Calibri" w:cs="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri"/></w:rPr><w:t xml:space="preserve">About TechHub

This guide is part of the TechHub Knowledge Base. For more step-by-step IT guides and support, visit techhub.com.lk.

Thanks for your feedback! 🙌

Read more

TechHub Assistant
Online · AI assistant
Thinking
⬇ Downloads 📦 Orders 🛒 Buy License 🎫 Create Ticket 🙋 Contact
AI-generated · may be inaccurate. Talk to a human