Avatar of HalCHub
HalCHub
Flag for United States of America

asked on 

getting values from the registry win 7 vbs

Hello given the following code:
strComputer = "."
Const HKCU = &H80000001 'HKEY_CURRENT_USER
strKeyPath = "Software\x\y"
szvalue = " "
szvaltype = " "
strname="z"


       Set oReg= _
          GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
          & strComputer & "\root\default:StdRegProv")
      
       oReg.GetStringValue HKcu, strKeyPath, strname, szValue  

      wscript.echo szvalue

      
  Where z is a reg_sz with a value of 1 does the code above echo reg_sz and not the value 1 ?
VB ScriptWindows 7

Avatar of undefined
Last Comment
Dany Balian

8/22/2022 - Mon