I'm currently using TCCv14 but I'm doing a trial of the new v23 because of the ability (since v18?) to read remote registry keys. For a project I'm doing, I'm currently using the Windows "reg query \\computer\whatever" with an @EXECSTR which is kind of clunky, but works.
One of the keys (for the old Groove / OneDrive for Business sync client) is a REG_BINARY. With "reg query" I can read it just fine... comes across as a big blob of hex, but that's fine, I'm just reading/storing it.
Now, introduce TCC v23 - I can read remote keys great with @REGQUERY for the strings/dwords. For that binary key though, no luck at all. I get an ugly "TCC: (Sys) The parameter is incorrect." no matter what.
Here's my test setup... simplifying it to make it easily reproducible:
First, in regedit, add a test REG_BINARY value like:
You should have a sample REG_BINARY in that location with the hex value 00 01 02 03
Now use @REGBREAD to read it locally, which should work fine:
Should have output of 0 1 2 3
So, that works great... but now, try and read it remotely (just doing it from the same machine to test it out)
Of course, make sure the remote registry service is started, like "net start remoteregistry"
Here's the error I get:
TCC: (Sys) The parameter is incorrect.
"%@REGBREAD[Software\JPSoft\Test]"
Just to prove it really can be read remotely, I use "reg query":
Output looks like:
HKEY_LOCAL_MACHINE\Software\JPSoft
Test REG_BINARY 00010203
I can read any other remote registry key just fine from systems, so I know the remote registry is working fine, reg query has no problems with it, it's only the @REGBREAD that seems to have an issue and I'm wondering why. For this test I'm using my local machine as my "remote", but it's the same on a real remote system as well.
PS - The help has what I assume is a copy/paste from @REGBWRITE when it says:
"length : The length (in bytes) to write to the registry key."
The registry read is probably not writing anything to the registry key, but to the buffer indicated by the handle.
One of the keys (for the old Groove / OneDrive for Business sync client) is a REG_BINARY. With "reg query" I can read it just fine... comes across as a big blob of hex, but that's fine, I'm just reading/storing it.
Now, introduce TCC v23 - I can read remote keys great with @REGQUERY for the strings/dwords. For that binary key though, no luck at all. I get an ugly "TCC: (Sys) The parameter is incorrect." no matter what.
Here's my test setup... simplifying it to make it easily reproducible:
First, in regedit, add a test REG_BINARY value like:
reg add HKLM\Software\JPSoft /v Test /t REG_BINARY /d "00010203"
You should have a sample REG_BINARY in that location with the hex value 00 01 02 03
Now use @REGBREAD to read it locally, which should work fine:
set handle=%@BALLOC[4]
set err=%@REGBREAD[HKLM\Software\JPSoft\Test,%handle%,4]
for /l %%i in (0,1,3) echos %@bpeek[%handle%,%i,1]^s
Should have output of 0 1 2 3
So, that works great... but now, try and read it remotely (just doing it from the same machine to test it out)
set handle=%@BALLOC[4]
set err=%@REGBREAD[\\%COMPUTERNAME%\HKLM\Software\JPSoft\Test,%handle%,4]
for /l %%i in (0,1,3) echos %@bpeek[%handle%,%i,1]^s
Of course, make sure the remote registry service is started, like "net start remoteregistry"
Here's the error I get:
TCC: (Sys) The parameter is incorrect.
"%@REGBREAD[Software\JPSoft\Test]"
Just to prove it really can be read remotely, I use "reg query":
reg query \\%COMPUTERNAME%\HKLM\Software\JPSoft /v Test
Output looks like:
HKEY_LOCAL_MACHINE\Software\JPSoft
Test REG_BINARY 00010203
I can read any other remote registry key just fine from systems, so I know the remote registry is working fine, reg query has no problems with it, it's only the @REGBREAD that seems to have an issue and I'm wondering why. For this test I'm using my local machine as my "remote", but it's the same on a real remote system as well.
PS - The help has what I assume is a copy/paste from @REGBWRITE when it says:
"length : The length (in bytes) to write to the registry key."
The registry read is probably not writing anything to the registry key, but to the buffer indicated by the handle.