Are all versions of Windows case insensitive?

18

3

I know the Windows OS is (generally) case insensitive. Is this true for all the Windows OSes (from Windows 95 up to Windows 7)? Is there any registry setup to make Windows case sensitive?

prosseek

Posted 2010-07-21T05:25:37.643

Reputation: 4 635

Case insensitive with respect to what? File names? Passwords? – Peter Mortensen – 2014-06-23T13:38:27.193

Not by default. Here is the right answer. – William – 2015-10-15T02:30:40.110

2Yes, as were all versions of MS-DOS from where this attribute was inherited. (Of course MS-DOS didn't preserve case, so things have moved forward :-).) – Richard – 2010-07-21T09:03:30.337

Answers

15

Yes, this is true for all versions of Windows. There is no way to make Windows case sensitive. Keep in mind though that some apps which were originally developed for Unix/Linux and then ported may be case-sensitive. Cygwin, for example, is case sensitive. This behavior is extremely rare though.

nhinkle

Posted 2010-07-21T05:25:37.643

Reputation: 35 057

Try running /bIn/BaSh in Cygwin and tell me again that it is case sensitive. – Matt – 2015-02-18T20:51:51.703

@Matt if you read all of the comments and answers here you'll see that's already been very thoroughly covered. – nhinkle – 2015-02-18T22:35:13.913

@nhinkle: Yes I've read everything. Yet the fact remains that since Cygwin runs on Windows and Windows uses case insensitive filesystems, there is nothing about Cygwin that can be said to be any more case sensitive than the Windows it runs on. – Matt – 2015-02-18T22:48:57.713

1

@Matt This answer isn't right(although they are appropriate answers posted). You just don't have case sensitivity enabled. http://superuser.com/questions/266110/how-do-you-make-windows-7-fully-case-sensitive-with-respect-to-the-filesystem I have to files one named testfile and Testfile. /bIn/BaSh doesn't work on my system.

– William – 2015-10-15T02:09:26.727

@William, so what you are saying is that you can run Windows on a case-sensitive filesystem, but Windows itself does not support it, so the case-sensitive files must be accessed through third-party software such as Cygwin. Is that correct? – Matt – 2015-10-15T15:52:53.663

@Matt Windows APIs don't support case sensitive files POSIX ones do. So yes I believe we understand each other. NTFS can support case sensitivity from what I understand. – William – 2015-10-15T15:56:25.743

7"There is no way to make Windows case sensitive." isn't quite accurate. There are ways to make parts of Windows case-sensitive, as explained in the other answers. – sleske – 2010-07-21T08:52:04.573

It's true though that from a user point of view, Windows filenames are case-insensitive, and there's no (easy) way to change that. – sleske – 2010-07-21T08:56:20.523

This is not True anymore, Now you could make Windows 10 case sensitive on a per-directory basis. See this article for more info.

– Navaro – 2019-11-26T22:54:17.217

Some aspects of Windows can be made case sensitive, but it relies on the capabilities of other PCs. Saving to a shared directory that is really on a Linux PC will allow case sensitive filenames to be used. This is due to the FILESYSTEM like @sleske said, not because "it's Windows" – UtahJarhead – 2012-10-03T17:26:30.293

1This is not entirely true. You can make severs versions of Windows and some desktop version case sensitive with Windows Services for UNIX. – Keltari – 2013-09-21T22:58:37.497

@Keltari thank you; that has already been pointed out multiple times in the past 3 years though... both in these comments and in other answers. – nhinkle – 2013-09-21T23:01:41.510

8

Actually, this depends on the API / Windows subsystem you (your program) use.

If you use the "Windows API" (the standard for Windows apps), then filenames are case-insensitive. However, if you use the POSIX subsystem (aka Windows Services for Unix), you can enable case-sensitivity.

See e.g. this MS Support article: Enable case sensitive behavior with Windows XP and Interix Subsystem or SFU

sleske

Posted 2010-07-21T05:25:37.643

Reputation: 19 887

6

Microsoft added a new case sensitive flag (attribute) that can be applied to NTFS directories (folders). For directories that have this flag set (enabled), all operations on files in that directory are case sensitive, regardless of whether FILE_FLAG_POSIX_SEMANTICS was specified. This means that if you have two files that differ only by case in a directory marked as case sensitive, all applications will be able to access them.

Starting with Windows 10 build 17107, Microsoft has added the ability to view and modify this flag to the fsutil.exe command.

To check if a directory is case sensitive, run the following command:

fsutil.exe file queryCaseSensitiveInfo <path>

To mark a directory as case sensitive, or case insensitive respectively:

fsutil.exe file setCaseSensitiveInfo <path> enable
fsutil.exe file setCaseSensitiveInfo <path> disable

Alexander Popov

Posted 2010-07-21T05:25:37.643

Reputation: 61

5

Cygwin tries to emulate Unix. Thus it needs to inherit case sensitivity to not break applications. Windows on itself isn't case sensitive. It's about the file system. You can read more about it in File system, File systems under Microsoft Windows (Wikipedia).

Mijndert Stuij

Posted 2010-07-21T05:25:37.643

Reputation: 331

Try running /bIn/BaSh in Cygwin and tell me again that it is case sensitive. – Matt – 2015-02-18T20:54:18.087

Correct. NTFS is case-sensitive, it's only disabled in Windows. One can enable it but it is extremely unsupported..so to say. – Apache – 2010-07-21T07:49:43.607

This is directed to the OP not MijndertStuij, but I didn't want to step on his toes. He deserves the rep on this one. Whether it's FAT (as the original MS-DOS and Windows versions) or NTFS (Windows NT and later), they are all case insensitive. You will notice these differences a bit if you save files to a Linux filesystem over Samba (File and Print Sharing's cousin). – UtahJarhead – 2012-10-03T17:24:57.737

From Wikipedia NTFS page: Allowed characters in filenames. - In Posix namespace, any UTF-16 code unit (case sensitive) except U+0000 (NUL) and / (slash). In Win32 namespace, any UTF-16 code unit (case insensitive) except U+0000 (NUL) / (slash) \ (backslash) : (colon) * (asterisk) ? (Question mark) " (quote) < (less than) > (greater than) and | (pipe) [5] – UtahJarhead – 2012-10-03T17:29:47.730

4

This is from here. 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.

Make sure to reboot after editing both.

William

Posted 2010-07-21T05:25:37.643

Reputation: 992

3

Barfieldmv is correct. The filesystem is indeed case sensitive and files are stored with their appropriate case. The file access layer is responsible for removing the case when matching files to new file descriptors

whardier

Posted 2010-07-21T05:25:37.643

Reputation: 141

You could say that windows is not case sensitive, but just case aware. That mean that it (windows) knows if letter is up case or lower case and it accepts both of them. It doesn't read one or the other as and error. – IGRACH – 2016-11-17T22:45:51.910

1Can you provide further details on how this abstraction between the filesystem and the user works (ie, provide a step by step example)? You should also address the op's actual questions on previous OSs and whether case-sensitive behavior can be forced. – MaQleod – 2012-10-03T17:16:22.510

I won't be able to provide a very full answer nowadays since I'm a huge Linux nerd now.. However I can offer the following. Windows Services for Unix utilizes the same filesystems as the operating system does, specifically, by not using the APIs that enable case insensitivity. See: http://support.microsoft.com/kb/817921 for info on how Case 'Preserving' is the same as Case 'Sensitive' however the common access layers allow for Case 'Ignorance' :)

– whardier – 2012-10-04T18:18:54.940