This happens most frequently when running programs and subsequently deleting them, such as when Steam updates itself or I rebuild a C++ program, but occurs occasionally with other files as well. For example, when Firefox downloads files it saves a *file*.*ext*
place holder and places the data as it is downloaded into a *file*.*ext*.part file. At the end of the download, Firefox sometimes fails to delete the placeholder and replace it with the *.part file. This is NOT a bug with Firefox.
To reproduce the problem without fail:
- I run one of my programming projects (I am using Visual C++ 2008 Express, by the way. Not that it matters much in this case though :P).
- Exit the program.
- *Optional* Shift-Right Click the output program and click Delete. It appears to be successful, but if you refresh the folder view you find a phantom file that you cannot manipulate.
- Try to Clean or Rebuild Solution.
- Receive the error:
- 1>------ Rebuild All started: Project: Win32 ScreenSaver, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'Win32 ScreenSaver', configuration 'Release|Win32'
1>Win32 ScreenSaver : error PRJ0008 : Could not delete file 'C:\Users\SilentDude56k\Desktop\Screensaver\Win32_ScreenSaver\Release\Win32 ScreenSaver.scr'.
1>Make sure that the file is not open by another process and is not write-protected.
1>Win32 ScreenSaver - 1 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
A workaround for this problem is to send the program to the Recycle Bin (omit pressing the Shift key when deleting) before cleaning/rebuilding. I can rebuild without any problems if I do this first.
I am using an Administrator account. My system is clear of any viruses, adware, etc. I have all the latest drivers for my hardware. I am running a genuine copy of Windows 7 Enterprise 64-bit. The paths to these files are far fewer than 260 characters in
length as well. Interestingly this problem does not occur on my laptop, which is also running Windows 7 Enterprise 64-bit.
Running Process Explorer and searching for the "Win32_ScreenSaver" handle brings up a result under System. The phantom file disappears once the handle closes. This usually takes a couple of minutes after attempting to delete it with either a Shift-Right
Click or a Clean/Rebuild Solution.
A list of what I've tried so far:
- Disabling all startup programs and all non-essential services, including ones from Microsoft. The problem is still there.
- Uninstalling all hardware drivers. The problem is still there.
- Booting into safe mode. This works. The file handle closes immediately upon exiting the program and I can successfully delete it.
I hope all of this information is helpful rather than bothersome. Thank you for your time. I hope we can solve this problem :)