Tuesday, October 31, 2017

Read, write and delete a key from windows system registry

Dim owshell, skeypath, Skeyval, skeytype
Skeypath= "hkey_current_user\mycustomekey\mycustomedata\myvalue"
Skeyval="this is UFT made registry"
Skeytype="reg_sz"

Set owshell= createobject("wscript.shell")
Owshell.RegWrite skeypath,Skeyval ,skeytype

Skeyval = owshell .RegRead(skeyPath)
Print Skeyval

Owshell .RegDelete skeypath
 'To run application
SApp="notepad.exe"
Owshell .run sApp
Set owshell = nothing

No comments:

Post a Comment