by VB_Fanatic (2 Submissions)
Category: Registry
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 23rd September 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Functions to read/write/delete a registry key (Very small code + No API's!)
Sub Main()
Dim RegObj, RegKey
Set RegObj = CreateObject("WScript.Shell")
RegKey = RegObj.RegRead("REGISTRY_KEY_TO_READ")
If RegKey = "" Then MsgBox "There is no registry value for this key!"
Else
MsgBox "Registry key value is " & RegKey & "!"
Set RegObj = Nothing
End If
End Sub
'Write a registry key
Sub Main()
Dim RegObj, RegKey As String
Set RegObj = CreateObject("WScript.Shell")
RegKey = "REGISTRY_KEY_TO_WRITE"
RegObj.RegWrite RegKey, "Value for the key goes here!"
Set RegObj = Nothing
End Sub
'Delete a registry key
Sub Main()
Dim RegObj
Set RegObj = CreateObject("WScript.Shell")
RegObj.RegDelete("REGISTRY_KEY_TO_DELETE")
Set RegObj = Nothing
End Sub
'Easy huh? ;-)
No comments have been posted about Functions to read/write/delete a registry key (Very small code + No API's!). Why not be the first to post a comment about Functions to read/write/delete a registry key (Very small code + No API's!).