In C# I can do the following:
DirectoryInfo di = new DirectoryInfo(System.Environment.GetEnvironmentVariable("ALLUSERSPROFILE"));
Which will get me the path to the all users profile.
In C++ I can use the SHGetFolderPath, but it does not seem to have a CSLID for all users. Is there an equlivant function that I can blow the %ALLUSERSPROFILE% out to its path value?
Use SHGetFolderPath
with CSIDL_COMMON_APPDATA
. Or SHGetKnownFolderPath
since Vista with FOLDERID_ProgramData
.
Alternatively, use the .NET native Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With