danke deddy, habs gerade mal getestet, bei mir scheint es das zu machen was es soll.
Delphi-Quellcode:
program Project51;
uses
Winapi.Windows,
Winapi.ShlObj,
Winapi.KnownFolders;
{$APPTYPE CONSOLE}
var
Path: PWideChar;
begin
if Succeeded(SHGetKnownFolderPath(FOLDERID_ProgramData, 0, 0, Path))
then
Writeln(Path);
Readln;
end.