Cannot delete [filename]: There has been a sharing violation. The source or destination file may be in use
Cannot delete [filename]: It is being used by another person or program. Close any programs that might be using the file and try again
No problem, you go ahead and close any running applications or programs you have open, and try to delete the file again. Instead you get the same message and the file still can't be deleted.
More than likely a Windows process has locked the file, which cannot be deleted, until the process ends. This means you need to identify the process and kill it so you don't need to reboot your computer just to delete a file.
The easiest way to identify the process is to use a utility called OpenedFilesView from nirsoft.net.
OpenedFilesView is a standalone portable program that requires no installation and can be run from your hard drive or a USB drive.
Just download OpenedFilesView, unzip and double click on OpenedFilesView.exe.
To find the file that you are trying to delete, you can click on the Filename column and sort the list in alphabetical order or search for the file by selecting Edit \ Find.
Once you find the file, take a look at the Process Name column. This will identify the process that has the file in a locked state.
Right clicking on the file will allow you to either close the file handles or kill the process.
Start with closing the file handle. If the file is still locked, then kill the process.
If you feel that OpenedFilesView is providing too much information, you can select which columns are displayed from the View menu (Choose Columns).
The Options menu, allows you to control which files are shown such as hidden files, network files, Svchost files, etc.
Also notice in the Options menu, you can enable OpenedFilesView in the right click context menu while working in Windows Explorer.
OpenedFilesView is a great utility to have available when removing viruses spyware that like to hide themselves in obscure folders.