ThisCalculator

Everyday

File Open Error: Causes & Fixes

Updated · Standard formula, shown below

File Open Error: Causes & Fixes

When Windows says “The action can’t be completed because the file is open in another program,” it means the file is locked by a running process, and you must close that program or release the lock before you can move, delete, or rename the file. This guide explains why the lock happens, how to find which program holds it, and the safe ways to clear it without losing data.

Why Windows Locks Open Files

Windows prevents you from modifying, deleting, or moving a file that another program is actively using. This is a safety feature: if you deleted a file while Word was writing to it, you could corrupt the document or crash the program. The lock is enforced by the operating system’s file system, which tracks which processes have the file open for reading or writing.

Common culprits include:

  • Office apps (Word, Excel, PowerPoint) that you left open in the background
  • Media players holding a video or music file
  • File Explorer preview panes that keep a thumbnail or metadata handle
  • Backup or sync tools (OneDrive, Dropbox) scanning the file
  • Antivirus software scanning a recently downloaded file
  • A program that crashed but left a background process running

Sometimes the lock is invisible: the program has no visible window, but a background process still holds the handle. That’s why simply “looking” for an open window often fails.

How to Find Which Program Has the File Open

Before you can fix the error, you need to identify the locking process. Windows has a built-in tool for this, but it’s not obvious.

  1. Press Ctrl+Shift+Esc to open Task Manager.
  2. Go to the Performance tab, then click Open Resource Monitor at the bottom.
  3. In Resource Monitor, go to the CPU tab.
  4. Expand the Associated Handles section at the bottom.
  5. Type the file name (or part of it) into the search box.
  6. The list below shows which processes have that file open.

If you see a process you recognize (like WINWORD.EXE or VLC.EXE), close that program normally. If the process is not something you recognize, do not force-kill it without checking what it is — it could be a system component or a legitimate background service.

Quick Fixes to Try First

Start with the least disruptive methods. These work for most users and don’t require special tools.

  • Close the program properly. If you see the program in the taskbar, right-click it and choose Close window. Wait a few seconds for the lock to release.
  • Restart the program. Sometimes the lock persists even after closing because the process lingers. Restarting the app often clears it.
  • Reboot your computer. This releases all file locks. It’s the most reliable fix, but it’s disruptive if you have unsaved work elsewhere.
  • Check File Explorer preview. If you have the file selected in a folder, the preview pane might hold a lock. Click on a different file or close the preview pane (View → Preview Pane).
  • Close the file in the app. If you have the file open in Word or Excel, make sure you’ve actually closed that specific document, not just minimized the window.

If none of these work, move on to the more advanced methods below.

Using Command Line Tools to Force-Close the Lock

When the normal methods fail, you can use built-in command-line tools to find and kill the locking process. This should be done with caution, as force-closing a process can lose unsaved work.

  1. Press Win + X and choose Terminal (Admin) or Command Prompt (Admin).
  2. Type tasklist | findstr /i "filename" (replace “filename” with your file’s name) to see which processes mention it. This is not always reliable because the file name may not appear in the process list.
  3. Better: use openfiles command. First, enable it by running openfiles /local on and restarting your computer. Then run openfiles /query to list open files. This only works for files opened over the network or by system services, not for local user apps.
  4. If you identified the process ID (PID) via Resource Monitor, you can force-kill it with taskkill /PID [PID] /F. Replace [PID] with the number.

Be aware that openfiles has limitations. The most direct method is still Resource Monitor, which gives you the PID without extra setup.

Third-Party Tools That Unlock Files

There are free utilities designed specifically to release file locks. They work by showing you which process holds the file and letting you close that handle. These tools are generally safe, but you should download them only from official or reputable sources.

  • LockHunter — Adds a right-click option “What is locking this file?” and lets you unlock or delete the file.
  • OpenedFilesView — A portable tool from NirSoft that lists all open files and the processes that opened them.
  • Process Explorer — A Microsoft tool (part of Sysinternals) that has a “Find Handle or DLL” feature. Search for your file name, then close the handle from the process properties.

These tools are useful when you need to unlock a file quickly and you’re comfortable with the risk of closing a handle. Always save your work in the locking program before force-unlocking, because you might lose unsaved changes.

Preventing the Error in the Future

Most file-lock errors are avoidable with a few habits:

  • Close documents before moving them. If you’re reorganizing folders, close all Office files first.
  • Disable File Explorer preview for large files. The preview pane can hold locks on images, PDFs, and videos. Turn it off if you frequently move such files.
  • Pause sync and backup tools. If OneDrive or your backup software is scanning a folder, it may lock files temporarily. Pause the sync, move the file, then resume.
  • Use “Save As” instead of “Save” when editing a file that you plan to move. This creates a new version and releases the old lock.
  • Check for stuck background processes. If a program crashes, its background process may still hold locks. Restart the program or reboot to clear them.

If you frequently get this error with a specific program, check for updates for that program — some apps have bugs that cause them to hold locks longer than necessary.

Frequently Asked Questions

Why does the error say “file open in another program” when I have no programs open?

This usually means a background process is holding the file. Common examples: a media player minimized to the system tray, a cloud sync tool that’s still uploading, or a crashed process that didn’t fully exit. Use Resource Monitor to find the actual process.

Can I just ignore the error and force-delete the file?

No. If you force-delete a file that a program is writing to, you can corrupt the file or cause the program to crash. It’s safer to close the program first. If you must delete it, use a tool like LockHunter that releases the handle, but be aware you might lose unsaved data.

Does this error happen on Mac or Linux?

Yes, but the message differs. On Mac, you might see “The operation can’t be completed because the item is in use.” On Linux, you’ll get a “Text file busy” or “Device or resource busy” error. The same principle applies: find the process and close it.

Will restarting my computer always fix the problem?

Yes, a full restart releases all file locks because all processes are terminated. It’s the most reliable fix, but it’s not always convenient. Try closing the specific program first, and only reboot if you can’t identify the process.

Is it safe to use a third-party unlocker tool?

Most are safe if you download them from the official source. However, they can close handles that are needed by the system, causing instability. Use them only when you’ve identified the process and you’re sure it’s not a critical system component. Always save your work first.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.