VBScript Help
Hi,
I have a strange problem looking up registry keys using VB.
Heres some sample code basically its checking that HKCU\ Exists
Can anyone shed any light on why it might work on some machines (works on my development PC and on another couple of users machines), but on other systems I always get "the unable to open registry key "HKCU\" for reading" error message. Any advice on where to start troubleshooting would be much appreciated
Regards
Jimmy
I have a strange problem looking up registry keys using VB.
Heres some sample code basically its checking that HKCU\ Exists
Set objShell = CreateObject("Wscript.Shell")
NoConfig = objshell.RegRead("HKCU\")
If Err.Number = 0 Then
WScript.echo "Configuration Exists"
Else
WScript.echo "Configuration does not exist"
End If
Can anyone shed any light on why it might work on some machines (works on my development PC and on another couple of users machines), but on other systems I always get "the unable to open registry key "HKCU\" for reading" error message. Any advice on where to start troubleshooting would be much appreciated
Regards
Jimmy
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
Jimmy, get hold of the registry class from JSWare.net. I think it's called 'cRegistry'. It has a raft of features which, even if you don't use them know, you certainly will in the future. One of those features is KeyExist (or KeyExists - I use a version which I've tailored and can't remember the original name). Don't be put off by the fact that it's got a scary "class" name. It's easy to use and the file has examples to follow. There's an INI class there, too.
Posted by:
jimmyx
15 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.