QTP code -Write to the Registry











Sponsored Links:


Write a value to the Registry.



' =============================================================
' Sub :    RegistryWrite
' desc :   Writes a key value to the registry
' params : strRoot is the root key, i.e. "HKLM", "HKCU"
'          strPath is the path to create, i.e. 
'          "Software\Test\Automation"
'          strValue is the value to write in the key
' returns : void
' =============================================================
Function RegistryWrite(strRootstrPathstrValue)

' create the shell object
Set objShell = CreateObject("WScript.Shell")

' write the key
objShell.RegWrite strRoot & "\" & strPathstrValue"REG_SZ"

' destroy the object
Set objShell = Nothing

End Function 'RegistryWrite

Source: https://qtphelper.com

No comments: