Wieso löst Du 'AppData' nicht einfach selbst auf?
Delphi-Quellcode:
Function LocalAppDataPath(AppNameWithoutExtension: String): String;
Begin
Result := IncludeTrailingPathDelimiter(GetSpecialFolderLocation(CSIDL_LOCAL_APPDATA));
Result := IncludeTrailingPathDelimiter(Result + AppNameWithoutExtension);
ForceDirectories(Result)
End;
Function GetSpecialFolderLocation(csidl: integer): String;
Var
pMalloc: IMalloc;
pidl: PItemIDList;
path: Array[0..MAX_PATH] Of Char;
Begin
Result := '?';
If SHGetMalloc(pMalloc) = S_OK Then
Try
SHGetSpecialFolderLocation(0, csidl, pidl);
SHGetPathFromIDList(pidl, path);
Result := IncludeTrailingPathDelimiter(Path);
Finally
pMalloc.Free(pidl);
End;
End;