Acesso remoto ao registro do windows - pq não funciona...

Delphi

08/07/2003

Olá...
Alguém consegui explicar por favor pq o cógido abaixo, usado como teste, não funciona???
Deveria ser apresentado qual a página inicial na máquina remota e não da máquina local.

Desde já agradeço...
Cristiano.



uses
Windows, …, Registry;
--------------------------------
Var
TesteRemoto: string;
---------------------------------
procedure Iniciar(Maquina: string);
var
Registry : TRegistry;
begin
Registry := TRegistry.Create;
try
if Maquina <> ´´ then
begin
Registry.RootKey := HKEY_LOCAL_MACHINE;
if Registry.RegistryConnect(Maquina) = true then begin
Registry.RootKey:= HKEY_CURRENT_USER;
Registry.OpenKey(´Software\Microsoft\Internet Explorer\Main´,false);
TesteRemoto := Registry.readString(´Start Page´);
ShowMessage(´Conectado...´);
end
else begin
ShowMessage(´Não foi possível acesso remoto...´);
end;
Registry.CloseKey;
end
else
begin
ShowMessage(´Não foi informado a máquina, registro local...´);
Registry.RootKey := HKEY_LOCAL_MACHINE;
Registry.RootKey:= HKEY_CURRENT_USER;
Registry.OpenKey(´Software\Microsoft\Internet Explorer\Main´,false);
TesteRemoto:= Registry.readString(´Start Page´);
Registry.CloseKey;
end;
finally
Registry.Free;
end;
end;
-------------------------------
procedure TForm1.Button3Click(Sender: TObject);
begin
Iniciar(´\\Maquina5´);
ShowMessage(TesteRemoto);
end;


Cristiano Lima

Cristiano Lima

Curtidas 0
POSTAR