- How to Solve “File Is Open in Another Program” Error in Windows 10
- Restart your computer
- Locate the File in Task Manager
- Restart file explorer through task manager
- Turn off the caching of thumbnails in hidden thumbs.db files
- Delete temporary files
- Empty Recycle bin
- Check the folder for viruses
- Conclusion
- Gizmo’s Freeware
- Login / Register
- Main menu
- How to Find Out Which Windows Process is Using a File
- How to find out what program is using a file
- How to find out which handle or DLL is using a file
- Which files are opened by a specific application?
- 4 Answers 4
- Not the answer you’re looking for? Browse other questions tagged windows process or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
- How do you find what process is holding a file open in Windows?
- 16 Answers 16
How to Solve “File Is Open in Another Program” Error in Windows 10
While using Windows 10, you may have tried to delete a file or move it to another location, and encountered an error which states “Action Cannot Be Completed Because The File is Open in Another Program”, even though you have not opened the file in any program. There are a number of reasons why this error might arise, so here are ways to tackle each of those reasons and solve the error:
Restart your computer
Turn off your computer and then start it up again. This method will end all pending tasks that may be causing the error and allow your File Explorer to restart its internal processes from scratch, which might help solve the issue you’re having. If not, move on to the next step.
Locate the File in Task Manager
Use the shortcut Ctrl + Shift + Esc to open Task Manager.
Look for the file in the Processes tab, which shows you all the applications that are currently being used, whether with or without your knowledge.
Select the file and tap on the “End Task” option near the bottom of the Manager window to stop the file from being used by a program.
Go back to the file and try to delete it again. If it still doesn’t work move on to the next step.
Restart file explorer through task manager
Once again, open Task Manager and go to the Processes tab.
Here you will find the Windows Explorer program currently in use. Select the process and tap on the “End Task” option.
Go to File at the top of the Manager window and select “Run New Task”.
In the new window that opens type “explorer.exe” and hit Enter.
This process will reboot Windows Explorer to clear up any problems with its memory or cached files that might have been causing the issue.
Once again go to the file and try to delete it. If it still doesn’t work move on to the next step.
Turn off the caching of thumbnails in hidden thumbs.db files
Microsoft has admitted in the past that the thumbnails cache relating to files and folders can cause the “File is Open In Another Program” error, so tackling the thumbnails cache can help resolve the error.
2. Type gpedit.msc and then hit Enter.
3. In the new window that pops up, go to “User Configuration -> Administrative Templates -> Windows Components -> File Explorer.”
4. Go to the right pane and double-click on the “Turn off the caching of thumbnails in hidden thumbs.db files.”
5. Select the button next to Enabled and then Apply, followed by OK.
All the thumbnails in File Explorer will now be disabled, allowing you to carry out the desired action on the file. You can then re-enable the thumbnails by following the above steps and changing the policy back to Not Configured.
Delete temporary files
Temporary files are stored on your computer every time you modify a file in any manner. These temporary files many be preventing you from moving or deleting the related files. Here is how you can get rid of the temporary files from your computer storage.
2. Type %temp% into the input bar and press Enter.
3. In the new folder that opens containing all the temporary files stored in your File Explorer, press Ctrl + A to select all the files and delete them together.
4. There may still be temporary files stored in another location. Again, press Win + R , type temp and press Enter.
5. Once again, select all the temporary files in the folder that opens and delete them all.
Empty Recycle bin
Sometimes, sending a file to the Recycle bin can be viewed as an action by your computer, which results in the error we have been trying to solve. Another way to solve the issue is to go to your Recycle bin and empty the entire folder by selecting the files and deleting them. Be warned that this will delete all the files in the recycle bin permanently, so make sure to only select the files you are absolutely sure you will no longer need.
Check the folder for viruses
Finally, if none of the above methods work, the problem might be more serious. There might be a virus associated with the file that is preventing you from making changes to the file. Run the file through your antivirus software to locate any virus or malware it might contain.
If this does turn out to be the case, isolate the file using your antivirus software, and delete it before it can infect other files.
Conclusion
The “File Is Open in Another Program” error can be a frustrating problem to encounter. Fortunately, there are a number of ways to tackle the issue as mentioned in the previous sections. If the cause of the issue turns out to be a virus, it is better to be aware of the fact that there is a virus inside your computer so you can take steps to remove the malware from your device.
Content writer with a keen interest in global technology and pop culture trends.
Gizmo’s Freeware
Login / Register
Main menu
How to Find Out Which Windows Process is Using a File
Last updated by v.laurie on 03. February 2021 — 14:53
Ever try to delete, move, or rename a file only to get a Windows system warning with something like one of these messages?
- «Cannot delete file: Access is denied»
- «There has been a sharing violation»
- «The source or destination file may be in use»
- «The file is in use by another program or user».
- «Make sure the disk is not full or write-protected and that the file is not currently in use»
One of the best ways to handle locked files or folders is to use the free Microsoft program Process Explorer. The program has been described in another article and here is how to use it to find out what program, DLL, or handle is using a file or folder. You will need to run as administrator.
How to find out what program is using a file
In Windows 7 or 8, the system message may tell you what program is using the file. If it doesn’t or if you are using Windows XP, there is a simple way to find the program:
- Open Process Explorer, running as administrator.
- On the toolbar, find the gunsight icon on the right (shown highlighted in the figure shown below).
- Drag the icon and drop it on the open file or folder that is locked.
- The executable that is using the file will be highlighted in the Process Explorer main display list.
How to find out which handle or DLL is using a file
- Open Process Explorer, running as administrator.
- Enter the keyboard shortcut Ctrl+F. Altenatively, click the “Find” menu and select “Find a Handle or DLL”.
- A search dialog box will open.
- Type in the name of the locked file or other file of interest. Partial names are usually sufficient.
- Click the button “Search”,
- A list will be generated. There may be a number of entries.
- An individual handle in the list can be killed by selecting it and pressing the delete key. However, care is necessary when deleting handles, as instabilities may occur. Often, just rebooting will free a locked file.
Process Explorer can be downloaded here.
Get your own favorite tip published! Know a neat tech tip or trick? Then why not have it published here and receive full credit? Click here to tell us your tip.
This tips section is maintained by Vic Laurie. Vic runs several websites with Windows how-to’s, guides, and tutorials, including a site for learning about Windows and the Internet and another with Windows 7 tips.
Click here for more items like this. Better still, get Tech Tips delivered via your RSS feeder or alternatively, have the RSS feed sent as email direct to your in-box.
Which files are opened by a specific application?
Is there a way to list all files that are currently opened by a specific process in Windows?
I mean files that got have an fopen , but never got an fclose by a specific process.
I tried to use Sysinternals Process Monitor, but I couldn’t figure out how to list the current opened files – but only when the opening happens.
4 Answers 4
You could try Sysinternals Process Explorer instead of Process Monitor. Process Monitor is design for watching what processes do as they do then. Process Explorer is more for seeing the current state of processes; it’s Task Manager but with about 10x the functionality.
Sysinternals also have handle.exe which is a command line tool that tells you which files a process has open.
Check out Process Explorer from Sysinternals.
To see the open files for a process, select a process from the list, select the View->Lower Panel View->Handles menu option. All of the handles of type «File» are the open files.
Also, a great way to find which application has a file open is by using the Find->Handle or DLL menu option. Just enter the name of the file you are looking for and hit «Search» to find the processes with a file open matching the search string.
Process Explorer from Sysinternals is actually pretty useless when it comes to dealing with file handles (as opposed to DLL’s, etc.). Use Windows Resource Monitor, click on CPU tab. Next to Associated Handles type the name of the file and you will see who has it open.
As Dave rightly said, use Process Explorer from SysInternals, apart from that they offer varying set of utils. Checkout: http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx
Not the answer you’re looking for? Browse other questions tagged windows process or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
How do you find what process is holding a file open in Windows?
One thing that annoys me no end about Windows is the old sharing violation error. Often you can’t identify what’s holding it open. Usually it’s just an editor or explorer just pointing to a relevant directory but sometimes I’ve had to resort to rebooting my machine.
Any suggestions on how to find the culprit?
16 Answers 16
I’ve had success with Sysinternals Process Explorer. With this, you can search to find what process(es) have a file open, and you can use it to close the handle(s) if you want. Of course, it is safer to close the whole process. Exercise caution and judgement.
To find a specific file, use the menu option Find->Find Handle or DLL. Type in part of the path to the file. The list of processes will appear below.
If you prefer command line, Sysinternals suite includes command line tool Handle, that lists open handles.
Examples
- c:\Program Files\SysinternalsSuite>handle.exe |findstr /i «e:\» (finds all files opened from drive e:\ «
- c:\Program Files\SysinternalsSuite>handle.exe |findstr /i «file-or-path-in-question»
You can use the Resource Monitor for this which comes built-in with Windows 7, 8, and 10.
- Open Resource Monitor, which can be found
- By searching for Resource Monitor or resmon.exe in the start menu, or
- As a button on the Performance tab in your Task Manager
- Go to the CPU tab
- Use the search field in the Associated Handles section
- See blue arrow in screen shot below
When you’ve found the handle, you can identify the process by looking at the Image and/or PID column.
You can then try to close the application as you normally would, or, if that’s not possible, just right-click the handle and kill the process directly from there. Easy peasy!
Just be very careful with closing handles; it’s even more dangerous than you’d think, because of handle recycling — if you close the file handle, and the program opens something else, that original file handle you closed may be reused for that «something else.» And now guess what happens if the program continues, thinking it is working on the file (whose handle you closed), when in fact that file handle is now pointing to something else.
Suppose a search index service has a file open for indexing but has gotten stuck temporarily and you want to delete the file, so you (unwisely) force the handle closed. The search index service opens its log file in order to record some information, and the handle to the deleted file is recycled as the handle to the log file. The stuck operation finally completes, and the search index service finally gets around to closing that handle it had open, but it ends up unwittingly closing the log file handle.
The search index service opens another file, say a configuration file for writing so it can update some persistent state. The handle for the log file gets recycled as the handle for the configuration file. The search index service wants to log some information, so it writes to its log file. Unfortunately, the log file handle was closed and the handle reused for its configuration file. The logged information goes into the configuration file, corrupting it.
Meanwhile, another handle you forced closed was reused as a mutex handle, which is used to help prevent data from being corrupted. When the original file handle is closed, the mutex handle is closed and the protections against data corruption are lost. The longer the service runs, the more corrupted its indexes become. Eventually, somebody notices the index is returning incorrect results. And when you try to restart the service, it fails because its configuration files have been corrupted.
You report the problem to the company that makes the search index service and they determine that the index has been corrupted, the log file has mysteriously stopped logging, and the configuration file was overwritten with garbage. Some poor technician is assigned the hopeless task of figuring out why the service corrupts its indexes and configuration files, unaware that the source of the corruption is that you forced a handle closed.