The Action Can’t Be Completed Because the File Is Open? How to Fix It

Avatar photo
Action Can't Be Completed on a Windows 11 laptop in a home office

Why Windows says the file is still open

You try to rename, move, or delete a file and Windows says the action can’t be completed because the file is open. The file is often not open in a window you can see. A background process, a preview, or a search indexer may still have a handle on it.

Typical causes are:

  • The file is open in another program, including one minimized or running in the system tray.
  • File Explorer’s Preview pane is locking the document you are trying to change.
  • A background service such as a backup, antivirus, or sync client has the file open.
  • A crashed app closed its window but left the file locked until the process is ended.

The steps below start with a simple close and work up to Resource Monitor and a restart. They apply to folders as well as files.

If the file is on OneDrive or a USB drive, pause sync or eject the device only after you have saved your work. A bad disconnect can leave the same lock behind.

Before you start

Create a restore point if you plan to take ownership or work in Safe Mode. A restore point will not unlock a single file by itself, but it gives you a way back if a later permission change goes too far.

  1. Press Windows key, type Create a restore point, and open System Properties, or run sysdm.cpl and select System Protection.
  2. Select the system drive, usually C:, then choose Configure.
  3. If protection is off, turn it on and set a modest disk usage amount, then select OK.
  4. Select Create, name the point Before locked file fixes, and wait until Windows reports that the restore point was created.

Sign in with the account that owns the file when you can. On a work or school PC, do not take ownership of a shared or policy-managed folder; ask IT instead.

Note the full path and file name, and whether you are trying to delete, rename, or move it. Do not force-delete anything under C:\Windows. Close the obvious app first, then use Task Manager, then Resource Monitor.

Quick-fix checklist for The Action Can't Be Completed on Windows 11

Work through those steps in order. After each one, retry the same file operation once before you end another process.

Fixes when the action can’t be completed in Windows 11

1. Close the program and try again

  1. Save your work and close the app that most likely has the file open, including Microsoft Word, Excel, Photoshop, a video player, or a command window sitting in that folder.
  2. Check the taskbar and the system tray for a minimized copy of the same app, then close it.
  3. Wait a few seconds and try the rename, move, or delete again.

If you just unplugged a camera, phone, or USB drive, eject it properly and, if a related device error appeared, see our USB headset Code 10 and Device Descriptor Request Failed guides for the device itself. The same file-in-use message can follow a storage device that did not unmount cleanly.

Success looks like the rename, move, or delete completing after the app closes. If the action can’t be completed still appears, the file is open in another program you cannot see, so continue with Task Manager.

2. Check that the file is open in another program

When Windows names another program, Task Manager is the quickest way to see which one.

  1. Press Ctrl + Shift + Esc.
  2. On the Processes tab, look for the app that should have the file, plus extras such as Office background processes, media players, preview hosts, and backup tools.
  3. Select a likely process and choose End task, then try the file again.
  4. If you are not sure, end only apps you recognize. Do not end Windows Explorer yet (that is Fix 4), and do not end critical Service Host processes at random.

Sign out and back in if a process you cannot identify keeps returning.

End only processes you recognize. If you are not sure whether the file is open in another program, leave system processes alone and go to the Preview pane check, then Resource Monitor.

3. Clear a file in use error from the Preview pane

This lock is very often File Explorer itself, holding a preview of a document, picture, or video.

  1. Open the folder that contains the file.
  2. On the View menu, turn off Preview pane. In some layouts this is View > Show > Preview pane.
  3. Click a different file, then try to delete or rename the original.
  4. If you use Details pane, turn that off as well and test again.

This is especially common with PDF, Office, and media files. A slow Explorer window can also keep a preview cached; if browsing the folder is already painful, see our File Explorer slow guide after you free the file.

Success looks like the file operation working as soon as the Preview pane is off. If a file in use error remains after you click a different item, restart Explorer before you end other processes.

4. Restart Windows Explorer

Explorer can keep a folder handle after the Preview pane is already off.

  1. Press Ctrl + Shift + Esc, find Windows Explorer, right-click it, and choose Restart.
  2. When the desktop returns, try the file operation again.

Restarting Explorer is safer than ending lots of random processes, and it often releases a locked Desktop or Downloads file.

Give the desktop a few seconds to return, then open the folder again and retry. If the lock is gone, you can turn the Preview pane back on later if you still want it.

5. Find handle in Resource Monitor

When you still cannot see the app, find handle in Resource Monitor and end only the process that owns the file. Microsoft describes this approach in Identify Which Process Is Blocking a File in Windows.

  1. Press Windows key + R, type resmon, and press Enter.
  2. Open the CPU tab and expand Associated Handles.
  3. In the search box, type the file name or part of the folder path.
  4. The list shows the process that has the file open. Right-click it and choose End Process, or close that program from its own window if it is something you still need.

Avoid ending System, csrss.exe, or winlogon.exe. If the handle belongs to antivirus or OneDrive, exit that app cleanly or pause sync instead of killing the core process.

When you find handle in Resource Monitor, type enough of the file name to avoid a long list. If several processes appear, close the user app first, and only end the process if that app will not close cleanly.

6. Unlock the file with PowerToys File Locksmith

If you would rather not hunt through Resource Monitor, Microsoft’s PowerToys includes File Locksmith. The official steps are in File Locksmith Utility for Windows.

  1. Install PowerToys from Microsoft Store and turn on File Locksmith.
  2. In File Explorer, right-click the locked file or folder, open Show more options if needed, and choose Unlock with File Locksmith.
  3. Review the list of processes, then end the one that should not be holding the file.

File Locksmith is the more guided way to do the same job as a handle search. Use it on a file you know is safe to unlock.

If PowerToys is not already installed, get it from Microsoft Store rather than a random download. After you unlock the file, try the operation once, then close File Locksmith so you do not leave a handle tool running in the background.

7. Delete locked file after a restart or in Safe Mode

If you only need to remove the locked item and no process will let go, a restart usually drops the handle.

  1. Restart the PC, then delete or rename the file before you open the app that was using it.
  2. If it is still locked, open Settings > System > Recovery > Advanced startup > Restart now, then choose Troubleshoot > Advanced options > Startup Settings > Restart and pick Safe Mode.
  3. In Safe Mode, delete the file, then restart normally.

You can also schedule a delete at boot with a trusted tool, but a normal restart or Safe Mode is enough for most home PCs. Do not force-delete system files in C:\Windows.

To delete locked file items in Safe Mode, use the same path you noted earlier. After the file is gone, restart normally and confirm that the parent folder opens without the old lock message.

8. Check permissions and ownership

Sometimes the message is really an access problem, even though it reads like a lock.

  1. Right-click the file or folder, choose Properties > Security, and confirm that your user account has Modify or Full control.
  2. If you do not, select Advanced, then Change next to the owner, enter your user name, apply the change, and tick the box to replace ownership on subcontainers if this is a folder you own.
  3. Try the action again.

Files from another user profile, an old PC, or an extracted archive can arrive with an owner Windows will not let you replace until you take ownership.

If the Security tab is missing or your change will not apply, stop on a work PC and ask IT. On a home PC, apply ownership first, then grant your account Modify, then retry the file operation.

9. Pause OneDrive, backups, and antivirus scanning

Sync and security tools often keep a short lock on a file you just saved.

  1. Pause OneDrive from its system tray icon, wait a few seconds, and retry.
  2. Temporarily pause other backup or “vault” tools that watch the same folder.
  3. If your antivirus has an “exclusions” or a pause option, use it only long enough to move the file, then turn protection back on.

If the file lives on a USB drive or an external SSD that keeps dropping out, fix the device connection first, then retry the file operation.

Pause is temporary. Turn antivirus and OneDrive back on as soon as the file operation finishes, then confirm that the file still opens from its new location.

If the file stays locked: deeper repair

If the Preview pane, Explorer restart, and Resource Monitor have already been tried, look for a third-party filter or a stubborn handle that returns after a restart.

  1. Press Windows key, type Event Viewer, and open it.
  2. Check Windows Logs > Application and Windows Logs > System around the times the lock appeared.
  3. Look for Explorer, antivirus, backup, or storage errors, then update or pause the named tool.

A clean boot can show whether a startup tool is locking the file as soon as Windows starts.

  1. Press Windows key + R, type msconfig, and press Enter.
  2. On the Services tab, select Hide all Microsoft services, then Disable all for the test only.
  3. On the Startup tab, open Task Manager and disable non-Microsoft startup apps.
  4. Restart, then retry the file operation before you open the usual apps.
  5. When you finish, open System Configuration, choose Normal startup, and restart.

If the action can’t be completed only in one account, test the same file from a second local administrator account after you copy it, or take ownership as in Fix 8. An in-place repair of Windows 11 with official Microsoft installation media can restore Explorer if the shell itself is damaged, but it will not unlock a file that a running app still has open. Back up first if you go that route, and do not use repair as a substitute for Safe Mode or a handle search.

Quick reference

What you seeTry this first
You know which app you usedClose it, then check Task Manager (Fixes 1 and 2)
The file is in use only in the folder you are viewingTurn off the Preview pane (Fix 3)
No window seems to have the fileUse Resource Monitor or File Locksmith (Fixes 5 and 6)
You only need to remove the locked itemRestart, then try Safe Mode (Fix 7)
The file came from another PC or userTake ownership and fix permissions (Fix 8)
The lock returns after you close the appCheck OneDrive, backup, and antivirus (Fix 9)
Resource Monitor lists several processesClose the user app first, then end only that process (Fix 5)
You need a simpler unlock toolUse PowerToys File Locksmith (Fix 6)

FAQ

Why do I get this message when the file looks closed?

A background process can keep a handle after the window is gone, which is why the action can’t be completed even though no window is visible. The Preview pane, OneDrive, and a crashed app are the usual hidden causes. Resource Monitor will show the process name.

How do I tell which program still has the file?

Use Task Manager first if you think the file is open in another program. If that is not enough, find handle in Resource Monitor by typing the file name, or right-click the file and use PowerToys File Locksmith.

What causes a file-in-use message in File Explorer only?

The Preview or Details pane is the most common reason for a file in use error. Turn both off and restart Explorer. A slow or stuck Explorer window can also hold the folder open.

Is it safe to delete the locked item in Safe Mode?

Yes, if you only need to delete locked file items that belong to you, and not a Windows system file. Safe Mode starts fewer apps, so the handle is usually gone. Do not delete items under C:\Windows unless you know exactly why they are there.

Why does the action can’t be completed appear only for one file type?

The Preview pane often locks PDF, Office, and media files. Turn off Preview and Details, then retry. If that file type is still locked, find handle in Resource Monitor and see which preview host or editor is holding it.

What if I only need to delete locked file items once?

Restart first, then try Safe Mode if the handle is still there. Do not use a force-delete tool on a system file, and confirm the path before you remove anything.

Can I search Resource Monitor handles for a whole folder?

Yes. Type part of the folder path in Associated Handles. Several processes may appear. Close or end only the ones that should not be in that folder, and leave System and security processes alone.

Sources

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
Photos App Not Working on a Windows 11 laptop in a home office

Photos App Not Working on Windows 11? How to Fix It

Next Post
Edge Opens on Startup on a Windows 11 laptop in a home office

Microsoft Edge Opens on Startup in Windows 11? How to Stop It

Related Posts