Kod
procedure RunOnStartup(
  sProgTitle,
  sCmdLine    : string;
  bRunOnce    : boolean );
var
  sKey : string;
  reg  : TRegIniFile;
begin
  if( bRunOnce )then
    sKey := 'Once'
  else
    sKey := '';
 
  reg := TRegIniFile.Create( '' );
  reg.RootKey := HKEY_LOCAL_MACHINE;
  reg.WriteString(
    'SoftwareMicrosoft'
    + 'WindowsCurrentVersionRun'
    + sKey + #0,
    sProgTitle,
    sCmdLine );
  reg.Free;
end;