Win7 RegRead works sometimes --Aargh!
I am trying to read a registry key value on Win7 64bit system and one time it will work and the next it won't. Driving me mad!
The key exists and has a value. The permissions say it should be readable.
About as simple a read as you can do in a vb script
Dim thing
thing = "HKEY_LOCAL_MACHINE\SOFTWARE\Intel\WirelessCommon\AppFramework\Settings\PROSetVersion"
sRegVer = oShell.RegRead(thing)
WScript.Echo sRegVer
Error is "Invalid Root in Registry Key"
which is usually a permissions thing provided your reg path and key are correct.
I have tested this on multiple systems with the same result.
if it never worked, then I know it is my fault, but if it sometimes works?!
Anybody run into intermittent read problems like this?
The key exists and has a value. The permissions say it should be readable.
About as simple a read as you can do in a vb script
Dim thing
thing = "HKEY_LOCAL_MACHINE\SOFTWARE\Intel\WirelessCommon\AppFramework\Settings\PROSetVersion"
sRegVer = oShell.RegRead(thing)
WScript.Echo sRegVer
Error is "Invalid Root in Registry Key"
which is usually a permissions thing provided your reg path and key are correct.
I have tested this on multiple systems with the same result.
if it never worked, then I know it is my fault, but if it sometimes works?!
Anybody run into intermittent read problems like this?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Posted by:
Lucid
14 years ago
Try this:
Option Explicit
Dim oShell, thing, sRegVer
Set oShell = WScript.CreateObject("WScript.Shell")
thing = "HKEY_LOCAL_MACHINE\SOFTWARE\Intel\WirelessCommon\AppFramework\Settings\PROSetVersion"
sRegVer = oShell.RegRead(thing)
WScript.Echo sRegVer
If that doesn't work, you might try VBScab's method, or else look into using the StdRegProv Class: http://msdn.microsoft.com/en-us/library/aa393664(VS.85).aspx
Dim oShell, thing, sRegVer
Set oShell = WScript.CreateObject("WScript.Shell")
thing = "HKEY_LOCAL_MACHINE\SOFTWARE\Intel\WirelessCommon\AppFramework\Settings\PROSetVersion"
sRegVer = oShell.RegRead(thing)
WScript.Echo sRegVer
If that doesn't work, you might try VBScab's method, or else look into using the StdRegProv Class: http://msdn.microsoft.com/en-us/library/aa393664(VS.85).aspx
Posted by:
anonymous_9363
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.