title: Check if Registry Key Exists not working
body: <p>I am trying to read a registry key and see if it exists - I have done the below but I keep on getting the error that the key does not exist...when it does? What am I doing wrong?</p>
  
  <pre><code>[Const HKEY_LOCAL_MACHINE = &amp;H80000002
  
  strComputer = "."
  Set objRegistry = GetObject("winmgmts:\\" &amp; _ 
      strComputer &amp; "\root\default:StdRegProv")
  
  strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains\localhost"
  strValueName = "http"
  objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
  
  If IsNull(strValue) Then
      Wscript.Echo "The registry key does not exist."
  Else
      Wscript.Echo "The registry key exists."
  End If
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/NrUvl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NrUvl.jpg" alt="enter image description here"></a></p>