Dark Times

Dark Times

63 comments · 95% upvoted · source · other discussions

comments

cmd_iii

There's a generation of people, completely computer-literate, who have no idea why the main hard drive in their computer starts with "C:\"

CrypticButthole

Mkay. I'm taking Systems Administration courses, and I'm a little ashamed to admit I don't know what C stands for. I'm not sure we covered it in my Windows Desktop class, maybe in the Windows Server class? Fuck, now I feel dumb.

delocx

Early versions of MS-DOS assigned drive letters as follows: the first floppy disk drive was assigned A, the second (if present) was assigned B, the first primary active partition of the first physical disk was assigned C, and so on. Two floppy drives were common because there were several floppy disk standards in use at the time. The rest is a mixture of legacy support (many early programs, and some more recent poorly coded ones, directly referenced a drive letter), and no real need to change it. You can open up your Windows Disk Management and assign drive letters A and B to basically any storage device and it will work just fine; there's only a few very niche times when that might cause a problem, usually with something really old.

Fun little fact, there's nothing that says that a drive (except the OS drive) has to be mounted to a drive letter. You can mount a drive within the folder hierarchy just like you see with Linux or BSD derived OSes.

CrypticButthole

I wrote a program in C++ that uses C:\Windows\Fonts hardcoded. Is there a way to remove the reliance on the C:\ drive holding the Windows directory? %SystemRoot% comes to mind but I don't think that's correct.

[deleted]

%SystemRoot%\Fonts

should be it.

CrypticButthole

Rhighto. And fopen("%SystemRoot%\Fonts\Arial.ttf") would expand %SystemRoot% correctly?

(I could test it, but I don't want to power on my laptop...)

[deleted]

Ah, using it there, not sure. Probably not. (It would be too easy.)

https://stackoverflow.com/questions/4130180/how-to-use-vs-c-getenvironmentvariable-as-cleanly-as-possible

Looks like you call GetEnvironmentVariableW and pass in "SystemRoot".

Riegel_Haribo

Registry [HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\

"Fonts"="C:\Windows\Fonts"

CrypticButthole

Hmm. It seems extremely inefficient to check the registry for the full fonts directory. I'm more concerned about \Windows\ being mounted elsewhere than C: than \ShellFolders\"Fonts" being set to something else. And does that registry entry update when \Windows\ is mounted to, say, Z:?

Riegel_Haribo

Windows doesn't just get "mounted" to Z: I don't even know that you'd be able to change the default installation directory on windows 10 these days; every update it reinstalls itself and just poorly copies back your settings. Making your own installation directory such as D:\win was dying by windows 98, usually just if you had done many upgrades from 3.1.