What determines whether the Windows $Recycle.Bin folder is mixed case or all uppercase?

On Windows, the Recycle Bin folder is typically located right under the device root, e.g. F:\$Recycle.Bin or D:\$RECYCLE.BIN.

Windows files systems are generally case-insensitive, so in most cases it does not really matter whether this folder name is spelled mixed case or all uppercase.

Out of curiosity and because I write cross platform code that also needs to run on case-sensitive file systems:

What determines whether the folder name is mixed-case or uppercase?

Ideas are: Internal vs external, Windows X vs Windows Y, NTFS vs FAT, ...


Solution 1:

Any user with Administrative permissions can rename the $Recycle.Bin folder to adjust capitalization.

Therefore, the capitalization of $Recycle.Bin cannot be determined by Windows version, Windows edition, file system, or other Windows installation attributes.

enter image description here

For your code, I would recommend retrieving a directory list or otherwise handling the folder name in a case-insensitive way.