What you are looking for is the SHGetKnownFolderPath function (or - on older versions of Windows - the SHGetFolderPath function ).
While Windows has conventions that these paths and where they are located are completely dependent on version, configuration, and other factors, so hard-coded folder names are a bad idea. However, the above was the function of getting these "special" folder locations from the very beginning.
The main argument of these functions is either KNOWNFOLDERID , or CSIDL , which indicates which folder you want.
"", : Windows. , , . .
, , :
FOLDERID_ProgramData/CSIDL_COMMON_APPDATA: , /etc/foorc. . , (, , /etc). .FOLDERID_RoamingAppData/CSIDL_APPDATA: . , , , , . , ~/.foorc. , .FOLDERID_LocalAppData/CSIDL_LOCAL_APPDATA: . , , , , . , Thunderbird , IMAP - , GiB .
, .foorc . Windows UNIX, , , ( ). , , Windows. , "" .
Ruby Win32API. ( ); , , .
. ALLUSERSPROFILE, APPDATA LOCALAPPDATA FolderID.