[Fixed] Action Cannot Be Completed Because the File is Open

[Fixed] Action Cannot Be Completed Because the File is Open

/ Sed Galope

“this action cannot be completed because the file is open in another program”

Encountering an error message can be a frustrating experience, especially when you need to complete a task urgently. This error message usually occurs when you try to modify or delete a file used by another program or process. Although the message can be confusing, the solution is often straightforward. This article will explore several ways to resolve this issue and complete your task.

Automatically Repair Windows File Errors

Recommended: To easily install drivers automatically, use the tool below.

Download Now
Fortect System Repair

Common Reasons for the “This Action Cannot Be Completed Because the File is Open in Another Program”

Here are three common causes of this error message “this action cannot be completed because the file is open”:

  • The file is currently in use: One of the most common reasons for this error is that another program or process uses the file you are trying to modify or delete. This can be a program you opened earlier, an operating system process, or even malware hiding in the background. To resolve this issue, you can either close the program using the file or restart your computer to terminate any running processes that might be using the file.
  • The file is locked: Another reason you might receive this error message is that the system locks the file you are trying to modify or delete. This can happen if the file is marked as read-only or the operating system has placed a lock to prevent it from being modified. To resolve this issue, you can try to change the file’s permission settings or use an administrator account to gain access to the file.
  • The file is corrupted: Sometimes, a file can become corrupted due to a virus, software error, or hardware failure. When this happens, the file might be used but cannot be modified or deleted. To resolve this issue, you can run a virus scan to remove any malware causing the corruption or use a file recovery tool to recover the file and create a new copy.

How to fix: Action Cannot Be Completed Because the File Is Open

Stop Background Processes

Via Task Manager

Encountering the “File in use, the action can’t be completed because the file is open” error is common and could happen for various reasons. The likely reason for this error message is that another program is using the file you are trying to access. You can use Task Manager to stop all background processes to resolve this issue. Follow these steps:

  1. Open Task Manager by pressing CTRL+ALT+DEL
  2. Select the processes and click “End Process.”
end icloud process

Via Resource Monitor

To start identifying and terminating processes that are associated with a file, use Resource Monitor:

1. Press and hold the Windows and R buttons on the keyboard.

2. Type “resmon.exe” into the pop-up field that appears and press “Enter.”

resmon exe command

3. This will launch the Resource Monitor. Click on the “CPU” section to expand it.

cpu section in resmon

4. Open the “Associated Handles” tab.

5. In the “Search Handles” field, type the file or folder name giving you the error message and press “Search.”

6. Once the Resource Monitor finishes its analysis, it will display a list of processes associated with the file you searched.

7. Right-click on each identified process and select “End Process” to terminate them.

end app process in resmon

8. Once you have ended all the processes associated with the file, try renaming, moving, deleting, or modifying the file again.

Once the background processes have been stopped, you can access the file without further problems. If the issue persists, try restarting your computer and reaccessing the file.

Empty the Recycle Bin and Restart

When attempting to delete a file, the “The action can’t be completed because the file is open” error is one of the most common errors that Windows users may encounter. The simplest way to resolve this error is by emptying the Recycle Bin. The Recycle Bin is a temporary storage location for deleted files, and emptying it permanently deletes all files. Therefore, the file causing the error should also be deleted. Start by:

1. Locate the Recycle Bin icon on your desktop.

2. Right-click on it and choose “Empty Recycle Bin” from the menu

recycle bin properties

3. Click “Yes” in the pop-up window to confirm that you want to delete all items permanently.

After the files are deleted, restart your Windows 11/10 computer and check if the error persists.

Delete Temp Files

Temporary files are typically generated when a new program is installed or a new document is opened. Deleting these files frees up space on your computer and can help to fix the “the action can’t be completed because the file is open” error, which can sometimes result from corrupted temporary files.

To delete temp files, follow these steps:

1. Press the Windows + R keys to initiate the Run dialog.

2. Type %temp% and press Enter.

run temp folder command

3. Press CTRL + A to select all files, then press Shift + Del to delete them permanently.

Once the process is completed, verify whether you have resolved the “The action can’t be completed because the file is open” error.

Restart File Explorer

The Windows Explorer process runs in the background of your computer’s system and can sometimes interfere with file modifications. Restarting File Explorer can make it more efficient and prevent it from obstructing your attempts to delete or rename a file. Here are the steps:

1. Right-click on the Start button.

2. Select the “Task Manager” option.

open task manager

3. Click “Processes,” scroll down to the bottom of the list, and select “Windows Explorer.”

4. Click on “Restart.”

restart the windows

Before attempting to reaccess the file, wait at least a minute.

Clean Up Your Thumbnails

The File Explorer process of using thumbnails can prevent certain file actions from being performed by running various processes. Disabling thumbnails can help stop these processes. Here are two methods to delete thumbnails:

Using Disk Cleanup

  1. Open File Explorer and select “This PC.”
  2. Right-click your primary disk and select “Properties.”
  3. Click “Disk Cleanup.”
  4. Choose the “Thumbnails” option and click “OK.” This will remove the thumbnails, allowing you to change your files.
select thumbnails in cleanup

Using Command Prompt

  1. Using Windows search, type “Command Prompt” to start accessing it.
  2. Right-click the Command Prompt and select “Run as administrator.”
  3. Check that the main system drive is selected. If found otherwise, type “C:” > press Enter.
  4. Type “del /ash /s thumbs.db” > press Enter.
delete thumbnails in cmd

Note that you need to wait at least 1 minute for the thumbnail libraries to be cleared. Once complete, try manipulating your file to resolve the issue.

Disable Thumbnails

In case deleting thumbnails helps to solve the problem and you want to stop their generation completely, there are various methods. You could try them even if none of the previous procedures worked on testing all the existing solutions.

Using File Explorer Settings

1. Open This PC and click View at the top of the window.

2. Select Options from the drop-down menu.

3. In the opened window, go to View, scroll down, and choose Always show icons, never thumbnails under Files and Folders.

always show icons never thumbnails

4. Click Apply, then OK so changes can be saved.

Using Performance Options

1. Access “This PC” and right-click on the space under your disks.

2. Select Properties and navigate to Advanced system settings.

3. Under Performance, click Settings.

advanced performance settings

4. Locate “Show thumbnails instead of icons” and uncheck it.

show thumbnails instead of icons

5. Click Apply, then OK.

Using Registry Editor

1. Press Windows + R buttons to initiate the Run dialog box >> type “regedit” into the field.

regedit

2. Open it up and confirm the UAC window.

allow regedit uac

3. Navigate to HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/Advanced on the left pane.

hkey current user explorer advanced

4. Find IconsOnly and double-click on it.

5. Change its value to 1 to disable thumbnails. To enable them back, type 0 instead of 1.

6. Click OK.

Using Group Policy Editor

1. Press Windows Key + R buttons and type gpedit.msc into the field and click OK or Enter to open it up.

gpedit msc

2. Navigate to User Configuration > Administrative Templates > Windows Components > File Explorer on the left pane.

gpedit file

3. Locate “Turn off caching of thumbnails in hidden thumbs.db files” and double-click on it.

turn off caching of thumbnails in hidden thumbsdb files

4. Set its value to “Enabled” > Click Apply and OK.

Launch Windows in Separate Processes by Changing File Explorer

To improve the stability of File Explorer when it is not distributing resources properly, it may be beneficial to configure it to open windows in separate processes.

1. Access “This PC” and click on the “View” tab.

File Explorer view tab

2. From the drop-down menu, select “Options.”

3. Access “Folder Options” on the window that appears; go to the “View” tab.

view tab in folder options

4. Check the box next to “Launch folder windows in a separate process.”

5. Click “Apply” and “OK.”

Use Clean Bootup

The Clean Boot feature in Windows allows users to start up their computer with only essential built-in apps and services, making it easier to identify if any third-party app or process is causing a problem. By starting your system in Clean Boot mode, you may be able to modify or delete files without encountering any issues. Follow these steps to launch your computer in Clean Boot mode:

1. Press and hold the Windows and R buttons, then type “msconfig” and press Enter.

msconfig

2. Click on the Services tab at the top in the System Configuration window.

3. Check the box next to “Hide all Microsoft services” > click on “Disable all.”

hide all microsoft services

4. Select the “General” tab and choose “Selective startup.” Ensure that the box next to “Load system services” is checked.

enable selective startup

5. Click “Apply” and “OK,” then restart your computer.

Try editing your files while in Clean Boot mode. Once you have resolved the issue, or if you cannot, it is important to return your Windows settings to Normal Startup. To do this, redo the previous steps and enable the disabled services, then change the startup option from “Selective” to “Normal.”

Disable the Homegroup

To leave a Homegroup and disable its services on your Windows computer, follow these steps:

1. Press Windows key + S and search for “homegroup.”

search homegroup

2. Select “Homegroup” from the results and click “Leave the homegroup.”

leave homegroup

3. Confirm that you want to leave the Homegroup and click “Finish.”

confirm leave homegroup

4. Open the Services window by pressing Windows key + R, typing “services.msc,” and clicking “OK.”

5. Double-click on “HomeGroup Provider” and set its “Startup type” to “Disabled.” Apply and click “OK.”

6. Double-click on “HomeGroup Listener” and set its “Startup type” to “Disabled.” Apply and click “OK.”

7. Open the Registry Editor and navigate to the path “Computer/HKEY_LOCAL_MACHINE/SOFTWARE/Classes/CLSID{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}”.

8. Create a new DWORD value named “System.IsPinnedToNameSpaceTree” and set it to 0. Save changes and close Registry Editor.

systemispinnedtonamespacetree value data

Change Your Folder View

To modify files from a specific directory, follow these steps:

  1. Open File Explorer.
  2. Go to the View tab.
  3. Select either Small icons, List, or Details from the menu.

After changing the folder view, you can modify all the files in this directory without encountering any issues. Remember that this is a workaround; you’ll need to repeat these steps for each directory causing the error.

To disable indexing locations and the Windows Search service, follow these steps:

  1. Press Windows key + S and enter indexing options.
  2. Select Indexing Options from the menu.
  3. Click on Modify and uncheck indexing locations.
  4. Click OK to save the changes.
  5. Press the Windows + R buttons to initiate the Run dialog box> type services.msc > click OK.
  6. Look for “Windows Search” from the options, then double-click it.
  7. Set the Startup type to “Disabled” > click “Stop” to stop the service.
  8. Click Apply, then OK for the changes to get saved.

Disabling Windows Search can cause issues with certain features, and you should restore everything to the previous state if any problems occur.

Stop Sharing for the Problematic Folder

Find the file or folder causing the problem to fix the error message. Once located, right-click the file or folder and select “Share with.” From the options, select “Stop sharing.” With unshared files and folders, you can move, rename, or delete the file without further issues.

Install the Latest .Net Framework

In some cases, not having the required .NET Framework installed can cause this issue since many Windows applications rely on it. To resolve this, download the necessary .NET Framework from the Microsoft website, which is free. To address the problem, installing all framework versions and verifying if the issue is resolved may be necessary.

Rename File or Directory via Command Prompt

To start accessing the command prompt and file renaming, follow this method:

  1. Launch Command Prompt as administrator.
  2. Type the desired directory and enter the following command, replacing “problematic_file.txt” and “new_name.txt” with the name and extension of the file you want to rename: “rename problematic_file.txt new_name.txt.”
  3. You can also use the command “rename c:path_to_problematic_file problematic_file.txt new_name.txt” as an alternative.

Alternatively, you may use the command “rename c:path_to_problematic_file problematic_file.txt new_name.txt.”

Note that if you cannot rename a file because it’s open in another program, you can use Command Prompt to rename it instead. Remember that this is an advanced solution, so ensure you understand the Command Prompt syntax beforehand. If you encounter an Access denied message in Command Prompt, try running it from Safe Mode.

Change Your Security Settings

To fix the problem, you must add missing security permissions for the problematic folder or file.

  1. Locate a working folder that doesn’t have this problem (use a non-system folder).
  2. Once the folder is located, right-click on it to access the “Properties” menu.
  3. Navigate to the Security tab and take note of the list of available groups and users.
  4. Repeat steps 1 to 3 for the problematic folder or file. Once you open the Security tab, check if any entries from Step 3 are missing.
  5. If any entries are missing, add them manually by clicking the Edit button.
  6. Click the Add button and enter the preferred user name or group in the Enter the object names to select the field” > click “Check Names.”
  7. Click the OK button.
  8. Please hover over the new additional user or group and select it to check Full Control in the Allow column.
  9. Click Apply and OK to save changes.

Change Dllhost.exe Security Permissions

To fix the error, you can change the security settings for dllhost.exe. The problem can sometimes occur due to problems with the COM Surrogate process, which is related to dllhost.exe.

  1. Press Ctrl + Shift + Esc to initiate Task Manager.
  2. Once Task Manager opens, navigate to the Details tab.
  3. Find dllhost.exe > right-click on it > choose “Properties”
  4. Navigate to the Security tab and click on the Edit button.
  5. Select “Administrators” > check Full control in Allow column.
  6. Click OK and Apply to save changes.

Note: End the COM Surrogate process if you encounter difficulty changing the security permissions. By opening the Task Manager, find “COM Surrogate” and select “End Task.”

Conclusion: Resolving the “File is Open” Dilemma

In conclusion, encountering this error message can frustrate and disrupt productivity. It is important to understand the potential causes to prevent it from happening in the future. While it may be tempting to immediately search for a fix, reflecting on what may have caused the error can help prevent similar issues from arising in the future.

By being mindful of the factors leading to this error, we can be more proactive in avoiding it and minimizing its impact on our work.

Sed Galope
Meet the author

Sedfrey is an experienced writer and editor. He's also a PC hardware and gaming enthusiast. In his spare time, he enjoys reading about the latest innovations in the PC market and finding fixes to hardware and software errors.