procedure LoadEnvironmentStrings(Strings: TStrings);
var
AllStrings, CurrentString: PChar;
begin
AllStrings := GetEnvironmentStrings;
try
if AllStrings <> nil then
begin
CurrentString := AllStrings;
while True do
begin
Strings.Add(StrPas(CurrentString));
Inc(CurrentString, Succ(StrLen(CurrentString)));
if CurrentString[0] = #0 then
Break;
end;
end;
finally
FreeEnvironmentStrings(AllStrings);
end;
end;