1 2 uses Registry 3 4 var 5 sKey : string; 6 reg : TRegIniFile; 7 sLoc :sting 8 begin 9 sLoc:=application.exename; 10 sKey:=application.title 11 reg := TRegIniFile.Create( '' ); 12 reg.RootKey := HKEY_LOCAL_MACHINE; 13 reg.WriteString('Software\Microsoft\Windows\CurrentVersion\Run'+ sKey ,sloc); 14 reg.Free; 15 end;