Greetings. There are the following:

Reg := TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; if not reg.RegistryConnect('\\192.168.247.128') then begin showmessage('НЕ УДАЛОСЬ (('); end; reg.RootKey:=HKEY_CURRENT_USER; reg.OpenKey('IDENTITIES', false); reg.WriteString('LAST USERNAME', 'HAHA'); 

he edits, but for some reason on my computer, and not on the one to which I am connecting. message

"FAILED"

does not crash, which indicates a successful connection to another's registry. The remote registry service on that computer is enabled.

    2 answers 2

    Write like this:

     var ErrStr:Pchar; begin Reg := TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; if not reg.RegistryConnect('\\192.168.247.128') then begin FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER or FORMAT_MESSAGE_FROM_SYSTEM, nil,GetLastError,LANG_USER_DEFAULT,@ErrStr,0,nil); ShowMessage(ErrStr); end; ... end; 

    see what the problem is. or manually call RegConnectRegistry and see the error in the same way:

     //см. registry.pas TRegistry.RegistryConnect Res:=RegConnectRegistry(PChar(UNCname), RootKey, TempKey); FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER or FORMAT_MESSAGE_FROM_SYSTEM, nil,Res,LANG_USER_DEFAULT,@ErrStr,0,nil); 

      That's right you have edited, even with an error, your registry. Here it would be necessary to ELSE and conclude editing in the runner