Deleting Files in x64 Operating Systems the right way
I first discovered this flaw in the x64 operating systems in Visual Studio. I noticed it wasn't deleting files when I told it to. Those of you that know me might know that I don't use a recycle bin. I have the global recycler set to permanently delete files. When I delete something, I am usually sure of it. If I want to recover it, I pull it out of a tape backup, which I have yet to do.
So let's say I open a 32-bit program, like Visual Studio or Abobe Fireworks. I open the "Open" dialog. I right click a file in there and select delete. It asks me if I want to send it to the recycle bin. That annoyed me. Because I removed the Recycle Bin from my desktop, so I had to regularly check the C:\RECYCLER folder for files that were
suppose
to be deleted. This may not seem critical, but in Visual Studio it was a problem. Say I open an FTP project, and work with some pages. You will see that VS retrieves the files and caches them locally for working with. Now I close Visual Studio, satisfied that I am done. All of those temp files ended up in my recycle bin.
Now, why does it do that and how can I fix it?
Well those that use the x64 OS know the registry in there is a little different. It works like the System32 and the SYSWOW64 folder. There is a registry key meant just for 32-bit Applications in HKLM\SOFTWARE\Wow6432Node. The operating system's settings fall in the HKLM/SOFTWARE key, so there are two places the recycle bin's settings are stored now. By default, the recycler's settings are stored here:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BitBucket
and the entry that controls weather a file is permanently deleted or not is a DWORD called NukeOnDelete. When you change the setting in the recycle, it doesn't change it in the SysWow6432Node. However, 32-bit programs like Visual Studio and Fireworks
do
read from the SysWow6432Node. So the recycler settings are out-of-sync. So if I were to set the entry:
HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\BitBucket@NukeOnDelete="1"
Then the 32-bit programs behave correctly.