Thanks,
How should I use TRegistry? I used the code below, but nothing happens (because the openkey always returns false)
const Env = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\';
// I used different values for this string with and without "\" in the beginning and end.
...
try
myreg := TRegistry.Create;
myReg.RootKey := HKEY_LOCAL_MACHINE;
if myReg.OpenKey(Env, false) then
begin
myReg.WriteInteger('hundred',100);
myReg.WriteInteger('thousand',1000);
end;
finally
myReg.Free;
end;
...