Sub WriteToRegistry() Dim regKey As Object Dim keyValue As String ' Define the key path and the value to set keyPath = "SOFTWARE\YourAppName" keyValue = "YourValue" ' Access the registry Set regKey = CreateObject("WScript.Shell") regKey.RegWrite "HKEY_LOCAL_MACHINE\" & keyPath, keyValue, "REG_SZ" MsgBox "Registry key created successfully!" End Sub