procedure AutoRunOnSystemStart(Title, FileName: String);
const
? _Software_Microsoft_Windows_CurrentVersion_Run_ : string = '\Software\Microsoft\Windows\CurrentVersion\Run\';
var
? Reg: TRegistry;
? Key: String;
begin
? Reg := TRegistry.Create;??????????????? // 創建一個新的注冊表
? Reg.RootKey := HKEY_LOCAL_MACHINE;????? // 將根鍵設置為HKEY_LOCAL_MACHINE
? Key := _Software_Microsoft_Windows_CurrentVersion_Run_; // 鍵Run
? Reg.OpenKey(Key, True);???????????????? // 打開這個鍵
? Reg.WriteString(Title, FileName);?????? // 在Reg這個鍵中寫入數據名稱和數據值
? Reg.CloseKey;
? Reg.Free;
end;
java程序開機自啟動?AutoRunOnSystemStart(self.Name, paramstr(0));?????????? // 開機自啟動
paramstr(0);為當前目錄下exe名,delphi7下可用Application.ExeName