How do you make Windows 7 fully case-sensitive with respect to the filesystem?

I want to make Windows 7 case-sensitive when it reads/writes anything on the hard drive (the C drive, or any other NTFS drive).

I found a video via google that says to change the registry key

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\DontPrettyPath

to a value of 1 (source).

I also found a Windows support item that says something about modifying the registry key

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive

that leads me to assume putting a value of 0 will make Windows case-sensitive with NTFS filesystems (source).

I have a feeling the second solution is the answer, but I'm not sure and I don't want to try it without being sure.

Does anyone know for sure what is the correct way to make Windows 7 case-sensitive when it reads/writes to the C drive (and any other NTFS drive)?


Solution 1:

You can set the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\ dword:ObCaseInsensitive registry value to 0 as other authors suggested. Create a file named add.reg with the following content and run it.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel]
"obcaseinsensitive"=dword:00000000

Then use Cygwin to work with case-sensitive filenames.

In order to do so, you need to mount NTFS filesystems with posix=1 option in your /etc/fstab, as this article suggests. Here's a snippet from my fstab:

none                    /cygdrive       cygdrive        binary,posix=1,user             0 0
C:                      /cygdrive/c     ntfs            binary,posix=1,user,auto        0 0
C:/Users                /home           ntfs            binary,posix=1,user,auto        0 0

Once the above is done, you'll be able to deal with case-sensitive filenames using bash, mc, git etc.

Solution 2:

All these settings that you can find on the web are for NFS not for NTFS (note the difference)!

NFS (Network File System) is a network protocol.

Thus changing the registry key HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive WILL NOT change anything you want.

NTFS is case-sensitive but Windows API is NOT, it only remembers the filename case. This mean that despite your file is displayed as AbC.TXT it is still accessible by abc.txt and aBc.TxT. This is a limitation of Windows, not NTFS.

The other one HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\DontPrettyPath basically turns off the normalization of legacy 8.3 filenames used by DOS (which are all caps). When it is turned on (default) ABC.TXT will be displayed as Abc.txt, but still be accessible by all other variations.

To be more accurate:

Actually it depends of the software that accesses the FS.

If it uses WIN32 API (which 99.9% of the software does) it will be case-insensitive whatever you do. All built-in software in Windows (like Explorer, command prompt, Internet Explorer and etc.) and all consumer software out there uses WIN32 and is always case-insensitive.

NFS Service, Java and some others are POSIX and they will obey the 'obcaseinsensitive' registry setting. However turning off the option might actually get you bigger problems, because this software can create files that are not accesible from Windows itself and other Win32 software.