Method One: Restart the computer in Safe mode to remove
When you restart the computer, press F8 to enter Safe mode. In Safe mode, the system does not actively run other programs, it is tantamount to an independent interference environment. In this way, the file will not be occupied by other programs or systems, you can directly delete the file or program. (This method is best)
Method Two: Delete in WinPE
Into the WinPE, but also to enter the safe mode almost, directly deleted on it.
method Three: Completely exit the program
is to shut down all programs that are relevant or running in the background that are connected to them. For example: When you open a song with a cool dog, and you want to delete the song. Just get the cool dog out of the way, which is generally OK. (but sometimes, if you quit the cool dog, you can't delete it, there's still a hint that the operation cannot be completed and the file is running in another program.) This will take a look at which program is occupied by the file, to find out and exit the program to complete the deletion. )
example, we have a test file that can't be deleted.
1. Right-Windows 7 taskbar-start Task Manager-performance-Resource Monitor
2. Click on the "CPU" tab in the console to navigate to the tab page
3. Enter "Test" in the search box to the right of "associated handle", where the system process associated with the test handle is automatically searched
4. You can see that the search process is cmd.exe (which confirms the scenario above). This means that the Cmd.exe process is invoking the test folder to cause a failure to delete the folder. Right-click the process, and then select the end Process command to eject the warning dialog box and confirm that the Cmd.exe process can be completed. Finally, delete the test folder and you can see that the folder was successfully deleted
The above method is correct in case of deletion, if you are Win7 permission problem causes cannot delete folder can be referenced under method to solve
If you use Windows7 optimization master, you can also enter the "System Setup Project" → Click on the "right menu" → Add the right mouse button menu items, tick "admin get ownership". Then, on those folders that cannot be deleted, right-click to select "Admin get Ownership", and then delete the file after the operation is complete.