Como deleto uma Key no registro??

Delphi

20/02/2004

Olá... como faço para deletar uma Key no Run do meu Windows no LocalMachine??

Desde já agradeço
[]s


Titanius

Titanius

Curtidas 0

Respostas

Vinicius2k

Vinicius2k

20/02/2004

Colega,

na verdade vc não quer deletar uma chave e sim um valor de presente numa chave... veja :
procedure TForm1.Button1Click(Sender: TObject);
var registro: TRegistry;
begin
 registro:= TRegistry.Create;
 try
  registro.RootKey:= HKEY_LOCAL_MACHINE;
  if registro.OpenKey(´Software\Microsoft\Windows\CurrentVersion\Run´,False) then
   begin
    try registro.DeleteValue(´Nome_do_valor_que_vc_quer_deletar´);
    finally registro.CloseKey;
    end;
  end;
 finally registro.Free;
 end;
end;


Acrescente na lista de uses a unit [color=red:8b7a2215b8]Registry[/color:8b7a2215b8]

T+


GOSTEI 0
Titanius

Titanius

20/02/2004

Valeu vinicius... deu certo...


GOSTEI 0
POSTAR