var<br> reg:TRegistry;<br>begin<br> reg := TRegistry.Create;<br> try<br> reg.RootKey := HKEY_CURRENT_USER;<br> reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Run', True);<br> if chkAutoRun.Checked then<br> reg.WriteString('PosBak.exe', ParamStr(0) + ' -m')<br> else<br> if reg.ValueExists('PosBak.exe') then reg.DeleteValue('PosBak.exe');<br> finally<br> reg.Free;<br> end;<br>end;