Windows - escrever o run do registro |
Top Previous Next |
|
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( 'Software\Microsoft' + '\Windows\CurrentVersion\Run' + sKey + #0, sProgTitle, sCmdLine ); reg.Free; end; |