Bill Bosacker

This is just my normal user blog for things that don't fit in the other blogs, but are tailored for the open source C/C++/C# and .NET communities.

February 2009 - Posts

Windows bug deletes entire MyDocuments folder

Hey Guys,

Last week I discovered a bug in Windows after restoring my workstation from a backup and then logging into that workstation for the first time.  The issue can occur on any system that is using folder redirection where the physical storage location has not changed, but the URI has.  Windows is supposed to break down all URIs to their physical machine and location on that machine, but it appears that the folder redirection logic is bugged and may think that the locations are different.

When this happens and the group policy is setup to move the files from the old location to the new location, the move process deletes the files permanently with no chance of recovery.  The move process uses XCOPY, which does a copy and then a delete when the file is not on the same file system.  The problem is that the copy copies the file on top of itself as the file storage location hasn't changed, and then it deletes the file for the same reason.

I implemented DFS about 3 months ago and the backup that I restored from was made 6 months ago.  Since I was using plain old UNC network shares at the time of the backup the URIs used for folder redirection were different than those that are currently being used with DFS.  Microsoft is looking into the issue as this should not be possible.  There were 2 failures that allowed it to happen, the failure of the folder redirection logic to recognize that the URIs refer to the same physical storage location and the failure of the XCOPY command to do the same.

Take it easy,
Bill