TRegistry的DeleteKey是删除整个键的,你应该用DeleteValue with TRegistry.Create do try RootKey := HKEY_LOCAL_MACHINE; if OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run\', False) then begin if ValueExists('我的启动') then DeleteValue('我的启动'); CloseKey; end; finally Free; end;
----------------------------------------------