@REGQUERY with hostname fails

This was working back in September. @REGQUERY fails whenever a hostname, local or remote, is given.
v:\> echo %@regquery[HKU\.DEFAULT\Environment\TEMP]

v:\> echo %_winname

v:\> echo %@regquery[\\zz\HKU\.DEFAULT\Environment\TEMP]

v:\> echo %@regquery[\\lucky\HKU\.DEFAULT\Environment\TEMP]
With a '.' as hostname, it seems to work but gives a result which is incorrect.
v:\> echo %@regquery[\\.\hklm\system\currentcontrolset\services\w32time\w32tmparams\ratedefault]
53 (incorrect)

v:\> echo %@regquery[hklm\system\currentcontrolset\services\w32time\w32tmparams\ratedefault]
156001 (correct)
And the help for many of the @REG functions contains a sentence apparently copied from @REGBREAD but not personalized for the function in question. For example, %REGQUERY's help says
If the key name begins with \\machinename, @REGBREAD opens ...
P.S., The "53" is the return value of RegConnectRegistry(); it's not from GetLastError().

And when viewing a thread, the user names (under the avatar) are no longer centered ... don't know why but it sticks out like a sore thumb.
You could use @REGEXIST to determine whether a -1 return from @REGQUERY is an indication of an error or the actual value.
I don't want to, but even that seems to fail, not returning 0 or 1 as documented.
v:\> echo %@regexist[\\no-exist\HKU\.DEFAULT\Environment\TEMP]
That's the Windows error code for "The network path was not found".


Staff member
May 14, 2008
Well -- no. If a variable function fails, it doesn't return *anything* (just an error message). Some variable functions expect the occasional missing argument or result, and return -1 to indicate they didn't find something.

The question is whether a non-existent machine name is a fatal error (abort the command line) or an occasionally expected error (return some error code).