How to get the full path to the AppData folder in Delphi?

    1 answer 1

    function GetDOSEnvVar(const VarName: string): string; var i: integer; begin Result := ''; try i := GetEnvironmentVariable(PChar(VarName), nil, 0); if i > 0 then begin SetLength(Result, i); GetEnvironmentVariable(Pchar(VarName), PChar(Result), i); end; except Result := ''; end; end; GetDOSEnvVar('AppData'); 

    Kopipast) :)