Web Hosting, Design, & Coding forum

General discussion

REMOTE Reg Query [reg.exe] in batch (.bat) WindowsXP

by jolly144 / March 2, 2006 2:55 AM PST

Guys, I am having a real hard time doing a basic REMOTE REGISTRY QUERY using REG.EXE under WindowsXP.
Using reg.exe from (04/20/1998), I know there is a new version (08/04/2004) but I can't seem to get it to work either so I kept using the old one (worked for me in the past).

I need to query the following registry value remotely: HKCU\Software\OP\LP\Update\Synch
(Key=HKCU\Software\OP\LP\Update\, Value=Synch)


For example:
Remote Machine IP = 192.168.0.1
Remote Machine Account = RB
Using a tool (psgetsid.exe) I can determine that the RB account's SID on 192.168.0.1 is: S-1-5-21-757019372-1432366915-1905203885-1000

[SCRIPT]
set Station1=HKU\%%c\Software // this will set %Station1%=HKU\S-1-5-21-757019372-1432366915-1905203885-1000\Software

ECHO APPROACH #1
reg query %Station1%\OP\LP\Update\Synch \\192.168.0.1
ECHO.
ECHO APPROACH #2
reg query \\192.168.0.1\%Station1%\OP\LP\Update\Synch
[/SCRIPT]

The OUTPUT of my batch file is as follows:

[OUTPUT]
APPROACH #1
Connecting to remote machine \\192.168.0.1

Listing of [S-1-5-21-757019372-1432366915-1905203885-1000\Software]

[Classes]
[Intel]
[Ligos]
[Microsoft]
[Netscape]
[ODBC]
[OP]
[Policies]
[POWERARC]

APPROACH #2
The specified path is invalid.
[/OUTPUT]
As you can see neither approach generated the correct result - all I want to know is the DATA associated with the VALUE "Synch" in the HKCU\Software\OP\LP\Update\Synch
Approach #1 at least gave me a list of the Keys (as you can see OP is there) but this is NOT what I want, I want to QUERY the specific value
Approach #2 doesn't seem to work at all...


So, for fun I tried using the new REG.EXE (08/04/2004) as follows:
[SCRIPT]
set Station1=HKU\%%c\Software // this will set %Station1%=HKU\S-1-5-21-757019372-1432366915-1905203885-1000\Software

ECHO APPROACH #1
reg query \\192.168.0.1\%Station1%\OP\LP\Update /v Synch
ECHO.
ECHO APPROACH #2
reg query %Station1%\OP\LP\Update /v Synch \\192.168.0.1
ECHO.
ECHO APPROACH #3
reg query "\\192.168.0.1\%Station1%\OP\LP\Update" /v Synch
[/SCRIPT]

And the corresponding output
[OUTPUT]
APPROACH #1

Error: Too many command-line parameters

APPROACH #2

Error: Too many command-line parameters

APPROACH #3

Error: The system was unable to find the specified registry key or value
[/OUTPUT]
As you can see Approach #1 and #2 don't work at all, and #3 says that it cannot find the value...???

Anyways - this isn't working - there has to be a way in windows XP to reg query a remote value ...
Any help, hints, or comments would be GREATLY appreciated...
Thanks,

Discussion is locked
You are posting a reply to: REMOTE Reg Query [reg.exe] in batch (.bat) WindowsXP
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: REMOTE Reg Query [reg.exe] in batch (.bat) WindowsXP
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Popular Forums
icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

GIVEAWAY

We are giving away 'Black Panther' swag!

Four lucky readers will be taking home *Marvel*ous "Black Panther" prizes, including magazines autographed by the King of Wakanda himself! Giveaway ends Feb. 25, 2018.