Problems with @REGBREAD on remote system


Mar 3, 2016
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:
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.

Just to prove it really can be read remotely, I use "reg query":
reg query \\%COMPUTERNAME%\HKLM\Software\JPSoft /v Test

Output looks like:
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.


Mar 3, 2016
You're the man! Looks like I'll have to dust off the credit card and finally update to the latest version. :) It's been since version 15 since I last updated, so... yeah, I'm overdue, and I like all the new features I've been missing out on.


Mar 3, 2016
Hmmm... I haven't tried my script in a while that was using @regbread on a remote system, but now that I've updated my system to 23.00.29 it's no longer working when I specify a remote computer with that function.

As an example, I started up the remote registry service on another computer and just created a simple little HKLM\Software\Test binary value with "00 01 02 03" in it. I can connect remotely with regedit and see it fine as well as "reg query" on it.

However, when I do the following, I get an error:
set comp=RemotePC set ghandle=%@balloc[1024] set err=%@regbread["\\%comp%\HKLM\Software\Test",%ghandle%,1024] set err=%@bfree[%ghandle%]

The error is:
TCC: (Sys) The parameter is incorrect.

The output of reg query \\%comp%\hklm\software /v test is as expected:
test REG_BINARY 00010203

Any thoughts? I could download 23.0.25 and make sure it's still okay there, although I haven't changed my code or anything since I last remembered it working, and my simple test seems like it should work okay. @regbread works great when doing a local query setup the same way, in my local HKLM. It only fails on the remote system and the error made it seem like it's stripping out the computer name and hive?
Similar threads
Thread starter Title Forum Replies Date
Charles S. Roaten Problems with TCSTART.BTM Support 1
vefatica Office problems better Support 0
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
Peter Murschall CMDebug 26.01.37 has problems with Alias Support 21
C unzip problems Support 2
C TCC 26 BATCOMP BTM problems? Support 5
Alpengreis WAD [v26 Beta RC3]: MSGBOX color problems Support 4
Alpengreis QUERYBOX problems Support 5
R New Cloud Storage Tab in TCC options causing problems Support 0
Craig Fitzgerald Problems using tcstart.btm Support 3
K_Meinhard Help problems Support 3
S Problems with dir command in the debugger Support 5
D How to? Path problems in TCC20 Support 1
G Version 20.11 installed on Windows 10 problems Support 9
M WAD Set statements in () causes problems Support 8
M Fixed Set "VAR=VAL" format causes problems Support 12
H Problems with PSUBST Support 3
Alpengreis The TCMD Display problems and font size ... Support 2
cgunhouse Problems With IFTP Support 3
Gamegod Fixed TCC identify Chinese problems Support 30
vefatica 21-22 Update problems Support 8
T Problems with the new help format Support 18
cgunhouse Event Plugin Problems With 19.10.43 Support 2
C @replace and @xreplace problems Support 5
Alpengreis Forum problems? Support 0
N Fixed Problems with SHA256/384/512 Support 5
Alpengreis [TC 19.0 Beta 22/23] Install/Update-"Problems" Support 4
P Problems registering Support 5
R Parser problems after build 44 Support 5
LowdhamStation Serial port problems Support 7
vefatica Is having ISP problems? Support 10
M Problems when being logged in Support 4
vefatica Both IFTP problems remain in build 50 Support 35
vefatica IFTP problems (broken pipe?) Support 24
Joe Caverly VIEW window in a TCC tab window problems Support 5
S Forum Implementation Problems Support 2
S Forum (XenForo) problems Support 3
S Problems to create new threads Support 6
S Fixed CLIPMONITOR problems Support 9
Roedy WAD Minor long-standing install problems Support 6
E Problems with Tabbed Toolbar Support 2
S Log and foldermonitor problems Support 3
vefatica Installation problems Support 1
J Problems for a neophyte Support 30
C Active FTP Problems Support 4
J Still problems understanding "foldermonitor" Support 9
J syntax problems multiple commands (command & command) Support 4
J 4NT problems after going to Windows 7 Support 5
vefatica Installer problems Support 23
cgunhouse Problems with ProcessMonitor Support 6

Similar threads