General discussion

Locked

VB5 and Windows 9x registry

By Tech010 ·
Please help. I developed a small program that manipulates the registry in a GUI this way our Admins don't have to weed through the registry manually, anyway. I have it working totally fin in Windows 2000, but it will not read or write to the Windows9x registry. Here's an example of the code:

I have a module with,
Public Function ReadKey(Value As String) As String

Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
r = b.RegRead(Value)
ReadKey = r
End Function

Then in the actual program to see the registered owner I would put:
Private Sub Command5_Click()
MsgBox "Registered owner of this system is: " & ReadKey("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Registeredowner")
End Sub

What is wrong with my code?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB5 and Windows 9x registry

by andrew In reply to VB5 and Windows 9x regist ...

Are you sure the key exists?
The key:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Registeredowner

has WindowsNT in it, which seems starnge for a 9x machine.

I think it should be:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Registeredowner

Collapse -

VB5 and Windows 9x registry

by Tech010 In reply to VB5 and Windows 9x regist ...

Poster rated this answer

Collapse -

VB5 and Windows 9x registry

by Tech010 In reply to VB5 and Windows 9x regist ...

Yes I understand, but this isn't the only entry I have in the program. I HAVE verified that the registry entries exist in Windows 9x. Any idead?

Collapse -

VB5 and Windows 9x registry

by andrew In reply to VB5 and Windows 9x regist ...

Got me stumped.
Your code looks fine.

Is WSH installed on the 9x machine?
Is it the correct version of WSH?

I'm grasping at straws.

You can try running just the script (a VBS file) to eliminate any problems coming from VB.

Good luck.

Collapse -

VB5 and Windows 9x registry

by Tech010 In reply to VB5 and Windows 9x regist ...

Poster rated this answer

Collapse -

VB5 and Windows 9x registry

by Tech010 In reply to VB5 and Windows 9x regist ...

This question was closed by the author

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums