WSH and JScript:  How to echo registry value names?

Posted on 2003-02-19
Medium Priority
Last Modified: 2007-12-19
Newbie question:

Registry shows:

- 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
    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.
Question by:wonda04
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

venyon earned 150 total points
ID: 7984591
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

An example (although in vbscript) is here on how to enmuerate registry keys and their values with regobj.dll can be found here:

Hope this helps.

Expert Comment

ID: 9474645
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 
Post your closing recommendations!  No comment means you don't care.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question