Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Find and read registry subkeys

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Find and read registry subkeys
  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 >>
 Find and read registry subkeys - 1/30/2006 8:14:34 AM   
  bernar


Posts: 6
Score: 0
Joined: 1/30/2006
Status: offline
Hi. I am trying to find a way to read value "displayname" from the registry without having to specify users. As seen below I have a subkey named abetan, abigal and about 200 other names. I would like to extract the subkey name via script and then use that to read the value "displayname" automatically. I know how to do it if I specify the subkey but I would like to atomate this. Thanks in advance


Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Interactive Intelligence\EIC\Directory Services\Root\BHMSCIC\Production\Users]
"snCreated"=dword:000007f4
"Date Created"=hex(7):31,00,36,00,00,00,00,00
"snModified"=dword:000007f4
[HKEY_LOCAL_MACHINE\SOFTWARE\Interactive Intelligence\EIC\Directory Services\Root\BHMSCIC\Production\Users\abetan]
"snCreated"=dword:000007f5
"Date Created"=hex(7):31,00,30,00,39,00,31,00,31,00,30,00,36,00,38,00,33,00,30,\
00,00,00,00,00
"snModified"=dword:000007f5
"NT Domain User"=hex(7):42,00,4f,00,52,00,53,00,43,00,48,00,4f,00,57,00,5c,00,\
61,00,62,00,65,00,74,00,61,00,6e,00,00,00,00,00
"Pop Client"=hex(7):4e,00,6f,00,00,00,00,00
"Ring Phone"=hex(7):59,00,65,00,73,00,00,00,00,00
"Pager Active"=hex(7):4e,00,6f,00,00,00,00,00
"Chat Chat Play Sound"=hex(7):59,00,65,00,73,00,00,00,00,00
"Attribute 2"=hex(7):34,00,31,00,37,00,30,00,00,00,00,00
"Attribute 3"=hex(7):34,00,31,00,37,00,30,00,00,00,00,00
"Mailbox Display Name"=hex(7):41,00,6e,00,67,00,65,00,6c,00,20,00,42,00,65,00,\
74,00,61,00,6e,00,63,00,6f,00,75,00,72,00,74,00,20,00,46,00,65,00,72,00,6e,\
00,61,00,6e,00,64,00,65,00,7a,00,00,00,00,00
"Ring Computer"=hex(7):59,00,65,00,73,00,00,00,00,00
"Chat Chat Pop Window"=hex(7):59,00,65,00,73,00,00,00,00,00
"Extension"=hex(7):34,00,31,00,37,00,30,00,00,00,00,00
"Auto-Answer Call"=hex(7):4e,00,6f,00,00,00,00,00
"ACD Agent Greeting"=hex(7):4e,00,6f,00,00,00,00,00
"Chat Client Play Sound"=hex(7):59,00,65,00,73,00,00,00,00,00
"Focus"=hex(7):4e,00,6f,00,00,00,00,00
"Date Last Modified"=hex(7):31,00,30,00,39,00,31,00,31,00,30,00,36,00,38,00,35,\
00,34,00,00,00,00,00
"Status Text"=hex(7):41,00,76,00,61,00,69,00,6c,00,61,00,62,00,6c,00,65,00,00,\
00,00,00
"Mailbox"=hex(7):45,00,58,00,3a,00,2f,00,4f,00,3d,00,42,00,6f,00,72,00,73,00,\
63,00,68,00,6f,00,77,00,2f,00,4f,00,55,00,3d,00,42,00,4f,00,52,00,53,00,43,\
00,48,00,4f,00,57,00,2f,00,63,00,6e,00,3d,00,52,00,65,00,63,00,69,00,70,00,\
69,00,65,00,6e,00,74,00,73,00,2f,00,63,00,6e,00,3d,00,61,00,62,00,65,00,74,\
00,61,00,6e,00,00,00,00,00
"Chat Chat Set Focus"=hex(7):4e,00,6f,00,00,00,00,00
"Exclude From Directory"=hex(7):4e,00,6f,00,00,00,00,00
"Chat Client Set Focus"=hex(7):4e,00,6f,00,00,00,00,00
"Chat Client Pop Window"=hex(7):59,00,65,00,73,00,00,00,00,00
"Fax Capability"=hex(7):59,00,65,00,73,00,00,00,00,00
"MWI Enabled"=hex(7):4e,00,6f,00,00,00,00,00
"displayName"=hex(7):41,00,6e,00,67,00,65,00,6c,00,20,00,42,00,65,00,74,00,61,\
00,6e,00,63,00,6f,00,75,00,72,00,74,00,20,00,46,00,65,00,72,00,6e,00,61,00,\
6e,00,64,00,65,00,7a,00,00,00,00,00
"emailAddress"=hex(7):45,00,58,00,3a,00,2f,00,4f,00,3d,00,42,00,4f,00,52,00,53,\
00,43,00,48,00,4f,00,57,00,2f,00,4f,00,55,00,3d,00,42,00,4f,00,52,00,53,00,\
43,00,48,00,4f,00,57,00,2f,00,43,00,4e,00,3d,00,52,00,45,00,43,00,49,00,50,\
00,49,00,45,00,4e,00,54,00,53,00,2f,00,43,00,4e,00,3d,00,41,00,42,00,45,00,\
54,00,41,00,4e,00,00,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\Interactive Intelligence\EIC\Directory Services\Root\BHMSCIC\Production\Users\abigal]
"NT Domain User"=hex(7):42,00,4f,00,52,00,53,00,43,00,48,00,4f,00,57,00,5c,00,\
61,00,62,00,69,00,67,00,61,00,6c,00,00,00,00,00
"snCreated"=dword:000007f6
"Date Created"=hex(7):31,00,30,00,38,00,32,00,30,00,38,00,38,00,32,00,38,00,39,\
00,00,00,00,00
"snModified"=dword:000007f6
"Mailbox"=hex(7):45,00,58,00,3a,00,2f,00,6f,00,3d,00,42,00,6f,00,72,00,73,00,\
63,00,68,00,6f,00,77,00,2f,00,6f,00,75,00,3d,00,42,00,4f,00,52,00,53,00,43,\
00,48,00,4f,00,57,00,2f,00,63,00,6e,00,3d,00,52,00,65,00,63,00,69,00,70,00,\
69,00,65,00,6e,00,74,00,73,00,2f,00,63,00,6e,00,3d,00,61,00,62,00,69,00,67,\
00,61,00,6c,00,00,00,00,00
"emsExtensionAttribute5"=hex(7):30,00,00,00,00,00
"displayName"=hex(7):41,00,62,00,69,00,67,00,61,00,69,00,6c,00,20,00,52,00,69,\
00,76,00,65,00,72,00,61,00,00,00,00,00
"departmentName"=hex(7):43,00,72,00,65,00,64,00,69,00,74,00,6f,00,00,00,00,00
"emailAddress"=hex(7):45,00,58,00,3a,00,2f,00,4f,00,3d,00,42,00,4f,00,52,00,53,\
00,43,00,48,00,4f,00,57,00,2f,00,4f,00,55,00,3d,00,42,00,4f,00,52,00,53,00,\
43,00,48,00,4f,00,57,00,2f,00,43,00,4e,00,3d,00,52,00,45,00,43,00,49,00,50,\
00,49,00,45,00,4e,00,54,00,53,00,2f,00,43,00,4e,00,3d,00,41,00,42,00,49,00,\
47,00,41,00,4c,00,00,00,00,00
 
 
Post #: 1
 
 RE: Find and read registry subkeys - 1/30/2006 9:13:13 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
Here is some code that might get you started. Not my code, but I forget where I got it from so I can't give proper credit. My apologies to whoever originally authored it:

      

_____________________________

"... 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 bernar)
 
 
Post #: 2
 
 RE: Find and read registry subkeys - 1/31/2006 1:09:41 AM   
  bernar


Posts: 6
Score: 0
Joined: 1/30/2006
Status: offline
Thanks for the quick reply. Very nice code...but only lets me read the values under a given subkey. In your example the key "Shell folders". In my case I have various keys which may be added or deleted daily. Because of this I would like a way to read the keys (to find out their names) then search for specific values under their names.

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Find and read registry subkeys - 1/31/2006 2:02:07 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I don't have these registry keys and no spare computer to risk importing the export section you posted but try the folloeing code.  It is untested but should get you going in the right direction.


      


Cybex

_____________________________

Common sense is not so common.

(in reply to bernar)
 
 
Post #: 4
 
 RE: Find and read registry subkeys - 1/31/2006 2:13:58 AM   
  bernar


Posts: 6
Score: 0
Joined: 1/30/2006
Status: offline
Thanks this is exactly what I want though it generates an Error: Object not a collection Code: 800A01C3 Runtime error en Line: 16 Char: 4 I will post the correction when done. Thank You very much

(in reply to bernar)
 
 
Post #: 5
 
 RE: Find and read registry subkeys - 1/31/2006 3:36:42 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
What type of data is "displayName"?  MultiString, what?


Cybex

_____________________________

Common sense is not so common.

(in reply to bernar)
 
 
Post #: 6
 
 RE: Find and read registry subkeys - 1/31/2006 5:41:04 AM   
  bernar


Posts: 6
Score: 0
Joined: 1/30/2006
Status: offline
Multi String

REG_MULTI_SZ

(in reply to bernar)
 
 
Post #: 7
 
 RE: Find and read registry subkeys - 1/31/2006 6:07:36 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
Try this code and echo the "subKey" and make sure it is pulling it ok and then echo "strKeyPath" & "strKeyPath2".  You need to make sure they are formatted correctly.


      

Cybex

_____________________________

Common sense is not so common.

(in reply to bernar)
 
 
Post #: 8
 
 RE: Find and read registry subkeys - 1/31/2006 7:17:30 AM   
  bernar


Posts: 6
Score: 0
Joined: 1/30/2006
Status: offline
Excellent it works fine I modified it to export to a file. If I may trouble you with one last question (newbie dude). How can I read multiple values say displayname and Extension or another known value?

(in reply to bernar)
 
 
Post #: 9
 
 RE: Find and read registry subkeys - 1/31/2006 8:03:30 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
This is dirty as far as variable names but try this and if it works you can clean up everthing.


      

Cybex

_____________________________

Common sense is not so common.

(in reply to bernar)
 
 
Post #: 10
 
 RE: Find and read registry subkeys - 1/31/2006 8:51:31 AM   
  bernar


Posts: 6
Score: 0
Joined: 1/30/2006
Status: offline
Excellent!!! I had tried something similar but it generated an error. When I tried ours I received the same error but then it hit me. The problem was that the first key did not have a value "Extension" I added it and then it worked. Thanks for all your help

(in reply to bernar)
 
 
Post #: 11
 
 
 
  

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 >> Find and read registry subkeys 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