Read the registry and display the contents

Author Message
KenPark

  • Total Posts : 23
  • Scores: 0
  • Reward points : 0
  • Joined: 9/28/2008
  • Status: offline
Read the registry and display the contents Friday, April 09, 2010 1:09 AM (permalink)
0
'==========================================================================
'
' VBScript:  AUTHOR: Kenneth Værsland 25.02.2010
'
' NAME: <ReadTheRegistry.vbs>
'
' COMMENT: Key concepts are listed below:
'1.use of constants for registry
'2. use of enumKey method
'3. use of Read The Registry
'==========================================================================
<Option Explicit
On Error Resume Next
Dim strKeyPath ' the portion of registry to read
Dim strComputer ' the target computer
Dim objReg ' holds connection to registry provider
Dim subKey ' used to enumerate throught the array
Dim arrSubKeys ' holds the sub keys
 
Const HKCR = &H80000000 'HKEY_CLASSES_ROOT
Const HKCU = &H80000001 'HKEY_CURRENT_USER
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Const HKU  = &H80000003 'HKEY_USERS
Const HKCC = &H80000005 'HKEY_CURRENT_CONFIG
 
'Key string can be altered as you wish
strKeyPath = "software\microsoft\Windows\Currentversion\Internet settings"
 
strComputer = "."
Set objReg=GetObject("winmgmts:\\" &_
                   strComputer & "\root\default:StdRegProv")
objReg.EnumKey HKCU, strKeyPath, arrSubKeys
dim s
s = "Keys under " & strKeyPath & vbCrLf
 'WScript.Echo("Keys under " & strKeyPath)
For Each subKey In arrSubKeys
    s = s & subKey & vbCrLf
    'WScript.Echo vbTab & subKey
Next
WScript.Echo s
>
 
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • 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
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9