• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1142
  • Last Modified:

WSH and JScript: How to echo registry value names?

Newbie question:

Registry shows:

HKEY_Current_User
- ParentKey
      (Default)      REG_SZ                  (value not set)
         Str1           REG_SZ                   Data1
         Str2           REG_DWORD        0x00000001(1)


Strictly using JScript...

If I am ONLY given the key name, "ParentKey", how would you go about retrieving ALL Value Names and their corresponding Value Data under this key?

That is, I would like to be able to WScript.Echo
  ParentKey
    Default: (Value not set)
    Str1: Data1
    Str2: 1
    ...


The extent of my knowledge with reading registry objects:

A simple RegRead requires a value name (ex.Str1)...

   var ws = WScript.CreateObject( "WScript.Shell" );
   WScript.Echo ( ws.RegRead("HKCU\\ParentKey\\Str1") );

Any ideas on how to get value names and more...?


Thank you in advance for any ideas.
0
wonda04
Asked:
wonda04
1 Solution
 
venyonCommented:
Unfortunately, WSH by itself only allows you to at most query if a key exists, but not enumerate them.

You can try using regobj.dll to achieve this however, you may find it at
http://cwashington.netreach.net/main/tools/default.asp?topic=n-z

An example (although in vbscript) is here on how to enmuerate registry keys and their values with regobj.dll can be found here:
http://cwashington.netreach.net/depo/view.asp?Index=140&ScriptType=vbscript

Hope this helps.
0
 
CleanupPingCommented:
wonda04:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now