Delphi-Quellcode:
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKey('
Software\Microsoft\Windows\CurrentVersion\Run', True)
then
begin
try
Reg.WriteString('
TempCleaner','
"' + ParamStr(0) + '
" ' + ParamStr(1) + '
"' + ParamStr(2) + '
"');
Reg.CloseKey;
except
Reg.CloseKey;
raise Exception.Create(SyserrorMessage(GetLastError));
else
raise Exception.Create(SyserrorMessage(GetLastError));
end;
finally
Reg.Free;
end;
end;
So würde ich es machen, glaube ich.