Jeg bruger dette stykke kode i en class fil
Public Property Get HentFraReg(Sti As String) As String
Dim WshShell As Object
Set WshShell = CreateObject("Wscript.Shell")
HentFraReg = WshShell.regread(Sti)
'MsgBox reg.HentFraReg("HKLM\SOFTWARE\Hej\Test")
End Property
Public Function SkrivTilReg(Sti As String, Navn As String, Data As String)
' Skriver til Registringsdatabasen
Dim WshShell As Object
Set WshShell = CreateObject("Wscript.Shell")
WshShell.regwrite Sti & Navn, Data
'reg.SkrivTilReg "HKLM\SOFTWARE\Hej\", "Test", "Hej Igen"
End Function