Sometimes you can not delete the file itself, but in SOME cases you can delete the folder that contain the file in questio. If you can't then.........

Goto Command prompt and use the following command:

rmdir foldername /s

Replace foldername with your folder's name, this commands should delete the main folder and all subfolders as well.

If all the steps went to no vail, then you can move to the follwoing step.

If this also doesn't work, there is a way to rename a file or folder during the boot process. For this you need to use the registry editor REGEDIT.EXE. See RegistryWarning.htm for a general warning.

Create an entry in

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Session Manager\

named PendingFileRenameOperations of type REG_MULTI_SZ. In pre-XP Windows versions you have to use REGEDT32.EXE to create this value type.

The first line of each pair is the current file or folder path and name with \??\ in front of it.

The second line of each pair is the new file or folder path and name with !\??\ in front of it.

Example for one pair which moves the file mfc42.dll from the temp folder to the system32 folder and overwrites any existing file at the destination:

\??\C:\TEMP\mfc42.dll
!\??\C:\WINDOWS\system32\mfc42.dll

You can add as many pairs as you like. The move operation is performed directly after the next reboot. You can also give folder paths, so the folder will be renamed. But both paths have to be local.

There is a Windows API call for this, named MoveFileEx, and somebody in Germany has even written a utility named MoveEx for it. You can download it from http://wwwthep.physik.uni-mainz.de/~frink/nt.html. Use it if you need this function often. A Posix utility from the Windows NT Resource Kit named mv.exe also does it, just in case you still have that resource kit around.

http://www.michna.com/kb/WxCannotDelete.htm
Helpful, I hope.

Cheers