Get Windows 98 registry values, VB6
Hi Everyone
Before I start I have to say this is an excellent forum for VBA/VB6 help - I'm a novice VB programmer but I often come here with issues and find the answers without making a post. This time I have an issue for which I haven't found an answer.
I have a VB6 project that extracts information from the users PC and it works well on Windows XP but it doesn't work on Windows 98 PC's. Part of the process involves extracting information from the registry using these commands :
Code:
Public Function GetInfo()
Dim oWSH As Object
Set oWSH = CreateObject("WScript.Shell")
GetInfo = oWSH.RegRead("HKEY_LOCAL_MACHINE\...")
'the previous line was truncated for the sake of brevity
End Function
As I mentioned, this works fine on XP PC's but fails on Windows 98 PC's (and I suspect it would also fail on Win 95 & ME). I have checked the registry and the identical path I'm seeking exists on the 98 PC, so I suspect the issue is with the "WScript.Shell" line.
How can this line (or code) be modified to accommodate other versions of Windows?
TIA, Andrew :)
P.S. I'm posting now from the '98 PC and I forgot to mention that the error is number 429 : "ActiveX component can't create object".