Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help accessing remote registry

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,65580
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help accessing remote registry
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help accessing remote registry - 10/28/2008 12:31:04 AM   
  maxhavoc

 

Posts: 7
Score: 0
Joined: 9/26/2008
Status: offline
I am trying to access a computer's remote registry with VBScript. I was looking around online and I found two ways to do it. I tried both and can get neither one to work. For all examples, I know that I have valid credentials so that's not the issue.

When I try this code I get an error, I:\test.vbs(2, 1) WshShell.RegRead: Invalid root in registry key "\\10.0.106.99\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB958644\Installed".

      

I take this to mean that I can't use RegRead to access a remote computer's registry, that I can only access local with this method. Is this correct?

When I try this code it returns NULL, I know that it should return 1 because when I use RegRead local it returns 1 (10.0.106.99 is my IP)

      

I can't figure out why the second code example won't work. What am I doing wrong?
 
 
Post #: 1
 
 RE: Help accessing remote registry - 10/28/2008 12:58:25 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
I'll do some testing, but my first suggestion would be to try it with the machine name instead of the IP address.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to maxhavoc)
 
 
Post #: 2
 
 RE: Help accessing remote registry - 10/28/2008 1:02:52 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
Ok, so with some testing, the code that you posted it works fine for me with machine name or ip address either one. In that case I would say that permissions are really the issue. Remember that simply being an admin on the machine may not be sufficient. It is possible that WMI permissions may not be configured to allow remote access as well.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Help accessing remote registry - 10/28/2008 2:33:05 AM   
  maxhavoc

 

Posts: 7
Score: 0
Joined: 9/26/2008
Status: offline
Did both code blocks work for you? Did you target your local machine by IP address or a remote machine? Did you explicitly provide credentials or use your logged in ones?

(in reply to ebgreen)
 
 
Post #: 4
 
 RE: Help accessing remote registry - 10/28/2008 2:48:36 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
I ran the second code block. I used my currently logged on credentials since that is how the code is written. I targetted a remote machine.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to maxhavoc)
 
 
Post #: 5
 
 RE: Help accessing remote registry - 10/28/2008 3:07:24 AM   
  maxhavoc

 

Posts: 7
Score: 0
Joined: 9/26/2008
Status: offline
And you got a return of 1? I don't understand it, I keep getting null.

(in reply to ebgreen)
 
 
Post #: 6
 
 RE: Help accessing remote registry - 10/28/2008 3:15:07 AM   
  maxhavoc

 

Posts: 7
Score: 0
Joined: 9/26/2008
Status: offline
I even tried something simpler, removing the IP address and just doing it local like this:

      

I *still* get null.

(in reply to maxhavoc)
 
 
Post #: 7
 
 RE: Help accessing remote registry - 10/28/2008 3:29:28 AM   
  dm_4ever


Posts: 2728
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Remove the initial \ you have before Software

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to maxhavoc)
 
 
Post #: 8
 
 RE: Help accessing remote registry - 10/28/2008 3:34:41 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
Ahh...I didn't read closely enough. I thought that you were getting an error on both. Change this line:

objReg.GetDWORDValue HKLM,"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB958644\","Installed",KEY

to this:

objReg.GetDWORDValue HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB958644","Installed",KEY


and see what you get.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to maxhavoc)
 
 
Post #: 9
 
 RE: Help accessing remote registry - 10/28/2008 3:35:47 AM   
  maxhavoc

 

Posts: 7
Score: 0
Joined: 9/26/2008
Status: offline
D'oh! Thanks dm_4ever!

ebgreen, yup, that works. Thanks to both of you.

(in reply to dm_4ever)
 
 
Post #: 10
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help accessing remote registry Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts