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.
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.
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.
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:?
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.
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 4 points · Jan 2022
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 10 points · Jan 2022
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 3 points · Jan 2022
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] 2 points · Jan 2022
%SystemRoot%\Fonts
should be it.
CrypticButthole 1 points · Jan 2022
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] 1 points · Jan 2022
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 2 points · Jan 2022
Registry [HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\
"Fonts"="C:\Windows\Fonts"
CrypticButthole 1 points · Jan 2022
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 1 points · Jan 2022
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.