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.
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 9 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".