The error “File is open in another program” occurs when you perform an operation on a file but because the file is being accessed by another program, you are not able to execute tasks or operations on it. This is a very basic principle which has been there in computing for a very long time. This is primarily done to reduce data inconsistency.
However, if the file is not used by any of the applications on your computer, this can be a troublesome error. The application might be in use by a hidden service, or there may be a bug which won’t let you perform the operations. We have listed down a guide for you to follow. Start with the first one and work your way down.
Solution 1: Using Task Manager
If you want to operate on a file but you get a prompt ‘file is open in another program’, you can open the task manager and see if there is any instance of the file open. There are several cases where other applications spawn a file for their own operational purposes or where the file is opened but hidden from view. Ending the instance of the file from task manager will free it allows you to operate without any problems.
- Press Windows + R, type “taskmgr” in the dialogue box and press Enter.
- Once in the task manager, search for the file which is giving the error. Right-click it and select “End task”.
- Close the task manager and try performing the operation you wanted to.
Solution 2: Changing File Explorer options
Another workaround to solve this problem is to disable ‘Launch folders windows in a separate process’. This will ensure that the folders windows are launched correctly and there is no conflict between different processes. You can always revert back the changes if this solution is not successful in your case.
- Press Windows + E to launch the file explorer. Select the tab ‘View’, press ‘Options’ and select ‘Change folder and search options’.
- Once Folder Options are opened, click on ‘View’ tab. Scroll down the list of options until you find ‘Launch folder windows in a separate process’. Uncheck the options.
- Press Apply to save changes and check if the problem at hand got solved.
Note: If the problem doesn’t go away after disabling the option, you can also try enabling it and check if the problem at hand got solved.
Solution 3: Deleting the file using Command Prompt
Another simple workaround is to delete the file you are trying to using the command prompt. You will have to navigate to the directory where your file is located. After we have located the file, we will end the file explorer, delete the file and start the file explorer again. Do note that you may require administrative privileges to perform this operation.
- Press Windows + E to launch the file explorer. Locate the file path of the directory where your file is located. Copy the file using the address bar present at the top of the screen.
- Once you have located the file, press Windows + S, type “command prompt” in the dialogue box, right-click on the application and select “Run as administrator”.
- Once in the elevated command prompt, type “cd” followed by space and file path of the directory where your file is located. It should look something like this:
- Press Windows + R, type “taskmgr” in the dialogue box and press Enter. Locate “Windows Explorer” from the process. Right-click on it and select “End task”.
- Your explorer will vanish from your screen leaving behind the applications still running. Don’t worry, we want this to happen. Open the command prompt (if it is in the background, use Alt + Tab to navigate through the applications). Once in command prompt, execute the following command. Here the real file name should be mentioned along with its extension. Do note if the file has spaces between it, this command will not work (for example ‘my memo.txt’ will not work). You will have to rename the file before any operations can be performed on it in the command prompt.
- The file is now deleted. Bring Task Manager back in the foreground, select File and click ‘Run new task’.
- Type “explorer” in the dialogue box and press OK. Windows Explorer will automatically be spawned. Check if the required operation is complete. You can also use “explorer.exe” if the above task doesn’t work.
Solution 4: Disabling Preview Pane
The preview pane is an option present in Windows Explorer which allows applications to be previewed separately on the side. It gives a short glimpse of the files what is contained in them. This can be useful for many users in many cases, but, it has proved to be a problem causing the error message under discussion. Follow the steps below to disable the preview pane.
- Press Windows + E, click ‘View’ tab from the top of the screen and uncheck the preview pane options. It should be present on the ribbon at the near left side.
- Close the Windows and launch it again. Now check if you can successfully perform the operation.
Solution 5: Using Resource Monitor
If all the above methods don’t work, it is highly likely that the file you are trying to perform the operation on is opened or being accessed by another application. We can try launching the resource monitor, locate the process accessing the file, end it and try doing the operation again. Do note that you might require administrator privileges to perform this action.
- Press Windows + R, type “resmon.exe” in the dialogue box and press Enter.
- Once in the Resource Monitor, click on ‘CPU’ Now select ‘Associated handles’. Type name of the file in the dialogue box and press Enter. From the results, right-click on each process and select ‘End Task’.
- Now check if the problem at hand got solved.
Note: If all the above methods don’t work, you should restart your computer. Restarting the computer will refresh all the files and their accesses which might solve the problem. Furthermore, you can also use third-party applications such as ‘Unlocker’.