WshShell.RegRead

Read a value from the Registry

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

Arguments:

         The Registry key or value must start with one of
         the following

         HKEY_CURRENT_USER  or HKCU
         HKEY_USERS         
         HKEY_LOCAL_MACHINE or HKLM
         HKEY_CLASSES_ROOT  or HKCR
         HKEY_CURRENT_CONFIG

Example

Set WshShell = Wscript.CreateObject("Wscript.Shell")
strIconSetting = WshShell.RegRead("HKCU\Control Panel\Desktop\IconSpacing")
WScript.Echo strIconSetting

"Machines can only find what ignorant men have programmed them to find" - Poul Anderson

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



Back to the Top

© Copyright SS64.com 1999-2011
Some rights reserved