Wednesday, February 16, 2011

Delete Registry Key

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
procedure BetaReset;
var Reg: TRegistry;
   
TheKey: string;
   
ListOfEntries: TStringList;
    i
: integer;
begin
 
Reg := TRegistry.Create;
 
try
   
Reg.RootKey := HKEY_CURRENT_USER;
   
TheKey := 'Software\MySection\MyAppName';
   
// Check if key exist...
   
// ...if yes, try to delete the entry for ApTitle
   
if not Reg.KeyExists(TheKey)
     
then ShowMessage('Key not found')
     
else begin
       
ShowMessage('Deleting '+TheKey);
       
Reg.DeleteKey(TheKey)
     
end;
   
if not Reg.KeyExists(TheKey)
     
then ShowMessage('Key not found')
     
else ShowMessage('Still Exists '+TheKey);
 
finally
   
Reg.Free;
 
end;
end;

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Kang Iwan K-sev | Thank's for your visit To My Site - Ridwan Mulyana | Cibeureum