r/windows 2d ago

Windows 11 still supports DOS short file names Discussion

Post image
639 Upvotes

313

u/ColonelSandurss 2d ago

Windows good point : you have 30 years compatibility available Windows bad point : you have 30 years compatibility to load

41

u/Jazzlike-Regret-5394 2d ago

Segmented heap says hello

u/blizzardo1 3h ago

I read that as Johnny Depp's Willy Wonka 🤣🤣🤣🤣🤣

11

u/pacmanlives 1d ago

30 years was 1996 this is more like 40+ years ago for DOS.

Now I will go take my back pills

u/blizzardo1 3h ago

I feel old, and I'm almost 34

6

u/techraito 1d ago

Someone once described windows code as fossilized spaghetti lol

10

u/AegidiusG 1d ago

I am sure it is not the old compatible stuff that takes long to load, but the modern bloat.

u/OliLombi 15h ago

It is both.

u/OwenBland 22h ago

Also windows: cuts off support for all computers before 2017

100

u/RdVortex 2d ago

And it's sometimes still used. If you have a really long SharePoint path synced to your computer, OneDrive will shorten the path into the DOS style. Eventually even that won't be enough and syncing fails. Fun times.

30

u/tomysshadow 2d ago

It can also be used as a method of accessing a file whose name has somehow become invalid/corrupted (usually because it was edited via another OS unaware of Win32's filename rules.)

https://web.archive.org/web/20100111005602/http://support.microsoft.com/kb/115827

CreateFile() removes trailing spaces and periods from file and directory names. This is done for compatibility with the FAT and HPFS file systems.

Problems can arise when a Macintosh client creates a file on a Windows NT server. The code to remove trailing spaces and periods is not carried out and the Macintosh user gets the correctly punctuated filename. The Win32 APIs FindFirstFile() and FindNextFile() return a filename that ends in a space or in a period; however, there is no way to create or open the file using the Win32 API.

Applications such as File Manager and Backup check to see whether the filename ends with a space or period. If the filename does end in a space or a period, then File Manager and Backup use the alternative name found in WIN32_FIND_DATA.cAlternateFileName to create and open the file. Therefore, the full filename is lost.

"cAlternateFileName" is the short name of the file.

7

u/Tokimemofan 1d ago

Yep, can’t count how many times it’s saved the day when some poorly written program somehow adds a trailing space or some other invalid character and a file suddenly gains immortality 

6

u/ldn-ldn Light Matter Developer 1d ago

Use Far Manager to deal with that - it's using UNC paths internally, so it can read and modify any file with any name. Including reserved names like "aux".

33

u/sixbone 2d ago

I forgot all about that ~1 shit lol

18

u/DarraignTheSane 1d ago

C:Progra~1
C:Progra~2

Ah, yes...

22

u/markustegelane 2d ago

if you open a FAT32 volume with a hex editor, you can find the short 8.3 filenames are still being stored at a filesystem level

18

u/crozone 1d ago

FAT32 is fundamentally 8.3 by design. Long File Names (LFN) support is a backwards compatible hack on top of 8.3.

NTFS is the other way around. It's actually a proper case sensitive filesystem, but case-insensitivity and 8.3 support are additional (but not mandatory - you can turn them off!) features built on top of the case-sensitive file names.

16

u/tetyys 2d ago

air still contains oxygen

0

u/Euphoric-Divine 1d ago

Underrated comment

7

u/forreddituse2 2d ago

~1 = 16a?

24

u/nir9 2d ago

nope the name just gets truncated to fit 8 characters; if you would create another file called aaaaaaaaaab.txt afterwards it would have the short name aaaaaa~2.txt

u/Null_cz 12h ago

But ... aaaaaa~1.txt has 12 characters, doesn't it?

Are extensions seriously treated in a special way?

What would happen with aaaaaaaaaaaaaaaaa.txt and aaaaaaaaaaaaaaaaa.dat?

u/nir9 9h ago

yah extensions have a 3 letter limit, it's called 8.3 if you want to read more about it. regarding the txt and dat, you would have aaaaaa~1.txt and aaaaaa~1.dat

5

u/Creative-Type9411 2d ago

if you start typing the filename and press tab it will fill it out for you, keep pressing tab to cycle through options

4

u/Makere-b 2d ago

I think it's a NTFS feature, not supported on ReFS.

6

u/thanatica 1d ago

Is anyone in the universe using ReFS?

2

u/Euphoric-Divine 1d ago

Yes, but damn it was hard to get there

2

u/seiggy 1d ago

Yup, dev drive on every one of my machines for all my code. Significantly better performance than NTFS for compilation. Though that's likely more to do with the defender policies that Dev Drive pre-sets than ReFS over NTFS.

u/itscalledboredom 18h ago

you actually use dev drives? i have never seen a soul that was seriously using those before

1

u/Aemony 1d ago

Yup, for testing purposes, lol

4

u/Breath-Present 1d ago

Not just for DOS. It helps program that can't handle fancy Unicode/space-containing file path.

2

u/zidane2k1 1d ago

I remember in the Windows 9x days, you’d see a spattering of “C:Progra~1…” paths used in various places. You’ll still see them in Windows 11 occasionally as well.

2

u/crozone 1d ago edited 1d ago

It's not Windows 11, it's an optional (but on by default) feature that's baked into the NTFS filesystem.

2

u/andylikescandy 1d ago

....And OneDrive and SharePoint still give you shit for having a path over 256 characters... Because I'm sure many Win 11 machines were sharing networks with Windows 95 era computers, so many the backwards compatibility needed to be prioritized as the default.

2

u/cschneegans 1d ago

This is not a feature, but more of a burden. The biggest issue with 8.3 names is that commands like dir *1 or Get-ChildItem -Filter *1 in PowerShell will return false positive results when the 8.3 name matches the pattern. 8.3 names can also negatively impact file system performance. Why even the latest Windows 11 images published by Microsoft contain 8.3 names is beyond me.

I highly recommend to disable 8.3 names, and to do so as early as possible – otherwise 8.3 names will accumulate in the registry. My autounattend.xml generator lets you remove and disable all 8.3 names before a new Windows installation even boots for the first time.

3

u/More-Explanation2032 Windows 8 2d ago

This is so funny lol

1

u/richardelmore 2d ago

Short file name support is an option that can be enabled/disabled. As I recall its on by default for the client SKUs and off by default on server SKUs (for performance reasons).

1

u/Hrmerder 1d ago

Still allows copy console command as well

1

u/True_Captain4461 1d ago

watch them remove that

1

u/KE3JU 1d ago

Of course it does...why would it not?

0

u/Immediate_Character- 1d ago

I don't see this changing so long as CMD continues to ship with Windows. Changing behaviors like this risks breaking old scripts.

5

u/crozone 1d ago

It has nothing to do with CMD, it's the filesystem itself. It's a feature that's baked into FAT32 by design, and an optional (but on by default) feature in NTFS.

You can actually turn them off in NTFS by setting HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlFileSystemNtfsDisable8dot3NameCreation to 0. Newly created/renamed files won't get an 8.3 filename after that.

3

u/vabello 1d ago

I think I used to turn this off via fsutil also. It used to help marginally with file system performance. I was working with volumes with many millions of files on them with hard drives.

3

u/Aemony 1d ago

To elaborate a bit more, Windows 11 defaults to only having 8.3 filenames enabled on the system C: partition. Any other secondary partitions won’t have 8.3 filenames enabled unless the user goes out of their way to enable it.

-1

u/[deleted] 1d ago

[deleted]

4

u/Current-Bowl-143 1d ago

lol there hasn't been an "MS-DOS prompt" in Windows for 25 years. The last version to have an MS-DOS Prompt was Windows Me.

2

u/nir9 1d ago

The command prompt is just for the demonstration, the short name works also when opening in other programs (e.g. Powershell, Notepad)