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;

CodePudding user response:

reference 1st floor day return reply:
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;

What method in the case of without programming registries delete directly from

CodePudding user response:

https://www.jb51.net/article/28171.htm

CodePudding user response:

Green version of the optimization of the master, removing the registry, delete again,
  • Related