Home > Back-end > How to delete the drive using the record
How to delete the drive using the record
Time:11-14
Want to ask how to through the use of registry delete drives record
CodePudding user response:
Use TRegistry can complete the registry operation Didn't test the following code, you can change test have problem,
The function DeleKey (key: string) : Boolean; Var I: integer; TMP: TStrings; Reg: TRegistry; The begin Reg:=TRegistry. Create; Reg. RootKey:=HKEY_LOCAL_MACHINE; If reg. OpenKey (key, false) then The begin TMP:=TStringList. Create; Reg. GetKeyNames (TMP); For I:=0 to TMP. Do the Count - 1 The begin Reg. DeleteKey (TMP [I]); end; TMP. Free; end; Reg. CloseKey; Reg. Free; end;