When you delete a file or folder, especially the temp temporary folder, you may experience the following error message "File is in use" or "the operation cannot be completed because the file is open in XXX."
(Please note: XXX represents the program that it opens.) )
Put this picture away. expand this picture
To successfully delete these files, first find out which processes have called them, and then close the related application. Compared to previous operating systems, the " file in Use " dialog box for Windows 7 has been improved, typically it lists what programs are in the calling file (as shown in the red box above). However, most of the time, the system still cannot list all the programs that call the file, so the file cannot be deleted smoothly. At this point, Windows 7 Resource Monitor --a small, but useful, tool--works.
Workaround:
Open the Resource Monitor. In the Start search box, type Resource Monitor and press ENTER to open.
Put this picture away. expand this picture
If you are prompted to enter an administrator password or confirm, type the password or provide confirmation.
Put this picture away. expand this picture
In the Resource Monitor dialog box, switch to theCPUtab. Click the small arrow to the right of the associated handle bar to expand it. Enter a filename in the search field (if the filename is longer, enter a partial filename), and then click Enter. All of the files associated with a file are now listed in the Image column.
Put this picture away. expand this picture
Select the process that calls the file, right-click the mouse, and click End Process .
Put this picture away. expand this picture
You can now successfully delete the related files/folders.
tip : Using the associated handle search, we can also query the registry key values corresponding to the process it! ^^