Technology
Leave a comment

These Windows storage rules make no sense until you remember DOS

These Windows storage rules make no sense until you remember DOS


Windows 11 looks every bit like a modern operating system, with rounded corners, Fluent Design, cloud services woven throughout, and plenty of technology that would have seemed ridiculous a few decades ago. Dig underneath all of that, though, and you start running into architectural decisions that have been hanging around for a very long time.

Every time you save a file, plug in a drive, or type a path into Command Prompt, you’re bumping into rules shaped by the time when PCs measured memory in kilobytes and storage space was precious enough to count carefully.

Modern Windows runs on the Windows NT architecture, which replaced the old MS-DOS foundation with a far more robust operating system. Even then, Microsoft had to preserve conventions that existing DOS and Windows software already expected. Some of those ideas reached even farther back to CP/M, which predates the IBM PC itself, and over time they became embedded in Windows APIs, scripts, installers, and everyday assumptions about how files and paths should behave.

The untouchable filenames

Why you can’t name a document after a con artist

Open File Explorer, create a new text document, and try to name it CON. Windows will reject it. The same happens with PRN, AUX, NUL, COM1, LPT1, and several related names. Changing the extension doesn’t help either, so CON.docx and NUL.pdf are just as unusable. The reason Windows still won’t let you use CON as a filename goes back to MS-DOS 1.0, when DOS addressed certain hardware devices by names that software could access, much like files.

Error: The specified device name is invalid.

A program that wanted to send something to the printer could write to PRN. CON represented the console, which covered keyboard input and screen output. AUX referred to an auxiliary serial device, while NUL worked as a bottomless trash can for data a program wanted to discard.

DOS 1.0 didn’t support directories, so there was little ambiguity. Once DOS 2.0 added subdirectories, those device names still needed to work regardless of which folder a program happened to be using. A command such as COPY FILE.TXT PRN had to keep meaning “send this file to the printer,” rather than “create a file called PRN here.”

Microsoft preserved that interpretation, and Win32 still reserves those names as DOS-style devices rather than treating them like ordinary filenames. More than four decades later, software and scripts can still expect NUL and CON to mean roughly what they meant on an early DOS machine.

The missing alphabet

Why your primary drive starts with the third letter

Windows File Explorer displaying the available storage capacities for a Windows (C) drive and a Library (D) drive.
Image taken by Yadullah Abidi | No attribution required.

Most Windows PCs still install the operating system on C:. If you plug in another drive, it might become D:, E:, or something farther down the alphabet, leaving A: and B: looking abandoned.

Those first two letters became associated with floppy drives early in the PC era. DOS used A: for the first floppy drive and B: for the second logical floppy drive. In fact, some machines with only one physical floppy drive could still expose both letters and ask you to swap disks when software switched between them.

When hard disks arrived on DOS PCs, Microsoft needed to fit them into an existing drive-letter scheme. Since A: and B: were associated with floppy drives, the first hard disk took C:. Floppies eventually disappeared, and modern Windows can even mount volumes inside folders without assigning them a drive letter. You can also assign A: or B: to other storage today.

C: remains the standard home for Windows because decades of software, installers, scripts, documentation, and user expectations have grown around it. Moving the system drive back toward the beginning of the alphabet would solve almost nothing while creating an impressive compatibility headache.

The crucial backslash

A missing stroke can change your destination

Windows command prompt running directory commands

C:\Data and C:Data look close enough that the second one could pass for a typo. In Command Prompt, however, they can point to different places.

C:\Data is an absolute path. The backslash after the drive letter tells Windows to start at the root of the C: drive and look for the Data folder there. C:Data is drive-relative. It can refer to a folder named Data in the current directory on drive C.

That strange behavior comes from DOS, which remembered a separate current directory for each drive. You could work deep inside a folder on C:, switch to D:, wander somewhere else, and later refer back to the location DOS remembered for C: without typing the whole path again.

Win32 programs have a single process-wide current directory, but Command Prompt recreates the old per-drive behavior for compatibility. It even keeps internal environment variables such as =C: to remember where each drive was last pointing. That’s also why C:\Data is the safer form in a script when you genuinely mean the Data folder at the root ofC:, since leaving out that backslash can make the destination depend on earlier commands.

The phantom tilde

Why PROGRA~1 is still on the guest list

Windows command prompt window listing directory contents.

Every so often, Windows coughs up a weird name like PROGRA~1 where you’d normally expect Program Files. That little abbreviation comes from the old 8.3 filename system that still leaves traces in Windows. Classic DOS filenames were limited to eight characters before the dot and three after it, which worked fine for AUTOEXEC.BAT. On the other hand, Financial_Statement_2026.xlsx most certainly did not.

When Windows 95 brought long filenames to Microsoft’s DOS-based consumer line, compatibility became a problem. Older DOS and 16-bit programs still expected short names so that Windows could keep an alternate 8.3 alias alongside the longer filename. That’s where the familiar tilde names came from, with Program Files commonly showing up as PROGRA~1.

Windows Command Prompt with directory listing

The actual naming rules get more complicated than just chopping a filename down to six characters and tacking on ~1, especially once multiple names start colliding. The important part is that both the long name and the short alias can point to the same file or folder.

Windows 10 and 11 still support 8.3 names today, although you can’t assume every file will have one. Short-name generation can be enabled or disabled globally or per volume, and Microsoft still provides the fsutil 8dot3name command for managing it.

Microsoft warns against casually removing existing short names because older software may still depend on them. In some cases, stripping those aliases can break applications or even leave software unable to uninstall cleanly.

The star that matches everything

Why the dot doesn’t really mean a dot

Windows command prompt running directory listing commands.

In Command Prompt, *.* has traditionally meant “everything in this directory.” Read literally, that sounds much narrower than how Windows actually uses it. You’d expect the pattern to mean any filename, followed by a dot, followed by any extension, which should leave a file like Notes out in the cold.

DOS handled filenames differently. Its classic 8.3 format stored the name and extension as separate fixed-length fields, with the first eight characters reserved for the name and the next three for the extension. The dot you saw on screen was just a separator between those fields, not an ordinary character taking up space inside the filename structure.

So, when DOS processed *.*, the first asterisk matched the name field and the second matched the extension field. An extensionless file still had an extension field; it was just empty, so the pattern matched anyway. That’s how *.* ended up becoming shorthand for “all files.”

Win32 abandoned the old DOS filename-matching algorithm once long filenames made that model impractical, but Microsoft preserved some of its quirks for compatibility. One of them is the familiar behavior of *.* which continued to mean effectively “all files” rather than only filenames containing a literal dot. Changing that behavior would have caused older scripts and programs to skip extensionless files they had always handled.

Windows keeps its ghosts around

These rules can look almost arbitrary on a Windows 11 PC because the hardware and software conditions that created them disappeared decades ago. CON, C:, PROGRA~1, C:Data, and *.* all made considerably more sense in a world of floppy disks, tiny filenames, and programs written around DOS conventions.

They’re hardly the only fossils still hanging around, either. Windows 11 still supports many legacy features because Microsoft has spent decades preserving behavior that existing hardware and software might still expect. Most of the time, you never notice that history. Every so often, though, you try to name a file CON or wonder why the alphabet starts at C:, and DOS pokes through the floorboards.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *