共用方式為


Duplicate Windows Folders

Hello my name is Shasank and today I am going to discuss a customer issue that we recently worked on where a customer reported that Windows Explorer was displaying two Windows directories and Windows Explorer (or powershell) could not remove the folder. For example:

clip_image001

Both folders had the same content. This extra \Windows folder was created by the Windows Search Service based on this DataDirectory registry key:

clip_image003

It was determined that an administrator had configured the following group policy for Windows Search Indexer Data Location

It was set to c:\windows search. When the Windows Search service saw this registry key it created a Windows folder with a trailing space as shown in the following from NTFSI output

     FRS 1568 <DIR> "Windows" //This is the original windows folder

     FRS 78b <DIR> "Windows " //This is the folder created by Windows Search that has the trailing space.

If we used dir /x to view the 8.3 names we could see the following:

clip_image004

We were able to finally remove the directory using one of the following commands:

rd C:\window~1

rd "\\?\C:\Windows “

Hope this helps if you ever encounter an issue like this. Thanks

Shasank Prasad
Senior Support Escalation Engineer
Microsoft Customer Service & Support

Comments

  • Anonymous
    May 30, 2016
    NTFS is case-sensitive in nature NTFS, however it can be enabled or disabled. This is what controls the ability of applications to create file names that differ only in case. The registry key below controls whether applications are allowed to issue case-sensitive file creates.HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KernelValue Name: ObCaseInsensitiveIf this is enabled, it will prevent applications from creating new duplicate names differing only by case. It does nothing to prevent the file system from retaining such names if they already exist. Some applications like Explorer use the FILE_FLAG_POSIX_SEMANTIC flag (Usually Unix applications) when case sensitivity is enabled, hence it does not detect that ABC==abcSo if you ever come across a server which has duplicate folders you can follow the below steps:1) Please ensure that ObCaseInsensitive is set to 1HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\KernelValue Name: ObCaseInsensitiveWhen the value of this reg key is set to 1, applications WILL NOT be able to create NEW duplicate filenames that differ only by case.When the value of this reg key is set to 0, applications WILL be able to create duplicate filenames that differ only by case2) Reboot the server after making the above registry changes.3) Take a back of the duplicate folder copy it to a separate drive4) Now rename the duplicate folder to .old and delete the duplicate folder.5) If the duplicate happens to be system protected directory one needs to follow the below steps with extra caution:In the below example consider you have 2 Sytem32 duplicate folders:i) Create a clone of the problem serverii) Boot the server in Winreiii) Rename duplicate system32 with lower case to system32.oldiv) Reboot the server in normal modev) Cut paste the system32.old to an alternate drivevi) Run CHKDSK command “chkdsk /f c:” and reboot the servervii) During the reboot chkdsk will get initiated. Wait for chkdsk to finish.viii) Once the server reboots please verify if all the required applications on the server are working as expected.Gangadhar