.RegRead

Read a value from the Registry

Syntax 
      strValue = objShell.RegRead(strRegistryKey\)
      strValue = objShell.RegRead(strRegistryValue)

Key

   objShell    A WScript.Shell object

   The Registry key or value must start with one of:

   HKEY_CURRENT_USER  or HKCU
   HKEY_USERS         
   HKEY_LOCAL_MACHINE or HKLM
   HKEY_CLASSES_ROOT  or HKCR
   HKEY_CURRENT_CONFIG

Examples

Dim objShell,strLogonServer,strDNSdomain

strLogonServer = "HKEY_CURRENT_USER\Volatile Environment\LOGONSERVER"
strDNSdomain = "HKEY_CURRENT_USER\Volatile Environment\USERDNSDOMAIN"

Set objShell = WScript.CreateObject("WScript.Shell")

WScript.Echo "Logon server: " objShell.RegRead(strLogonServer) 
WScript.Echo "DNS domain: " objShell.RegRead(strDNSdomain) 

“Machines can only find what ignorant men have programmed them to find” ~ Poul Anderson

Related:

Registry, delete - .RegDelete
Registry, write - .RegWrite
Equivalent Windows CMD command: REG - Read, Set or Delete registry keys and values
Equivalent Powershell command: Get-Item


© Copyright SS64.com 1999-2014
Some rights reserved