I have a hard drive and this is a bad file on it! When I want to delete file windows says:
"The file name you specified is not valid or too long. Specify a different file name."
But the file not renamed! What do I do?
You cannot modify a resource when a running process has a handle to it.
The solution is to end all processes that have a handle to your resource. This is shown below.
1. End all processes that have a handle to the resource:
Start>>All Programs>>Accessories>>System Tools>>Resource Monitor (or Run resmon.exe
)
Search for the resource in the Associated Handles searchbox (circled in red). Look in the Handle Name column to see if any of the processes have a handle to the resource's URI and end those processes by right clicking and selecting End Process.

2. You should now be able to modify your resource, e.g. delete, rename, move, etc.
Boot an Ubuntu live CD, navigate to the offending folder, and delete whatever files you want. I tried all of the other solutions and none of them worked for me, but Ubuntu did.
来源:https://stackoverflow.com/questions/23676827/how-force-delete-the-file-on-hard-drive-in-windows-7