Wednesday, 19 October 2011

QTP Script: 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

7 comments:

  1. I like what you guys are usually up too. This kind of clever
    work and reporting! Keep up the excellent works guys I've
    incorporated you guys to blogroll.

    My web site ... play minecraft

    ReplyDelete
  2. Great goods from you, man. I have understand your stuff previous to and you are just
    too fantastic. I really like what you've acquired here, certainly like what you're saying and the way in which you say it.

    You make it entertaining and you still take
    care of to keep it smart. I can't wait to read far more from you.
    This is really a terrific website.

    Feel free to surf to my web blog ... minecraft

    ReplyDelete
  3. Very nice post. I just stumbled upon your blog and wanted to say that I've truly enjoyed surfing around your blog posts.
    In any case I'll be subscribing to your rss feed and I hope you write again very
    soon!

    Check out my web page ... minecraft game

    ReplyDelete
  4. Saved as a favorite, I love your website! Quest Bars blogesaurus

    ReplyDelete
  5. I visited several blogs but the audio feature for audio songs existing at this site
    is really excellent.

    Take a look at my website :: quest nutrition quest bars

    ReplyDelete
  6. You're so awesome! I do not believe I've read through a single thing like that before.
    So wonderful to discover someone with unique thoughts on this issue.
    Really.. thanks for starting this up. This website is one thing that is needed
    on the web, someone with a little originality!

    Here is my web site :: Diet Plans for Women to Lose Weight

    ReplyDelete
  7. Generally I don't learn article on blogs, but I would like to say
    that this write-up very forced me to take a look at and do it!
    Your writing taste has been surprised me. Thanks, very great article.
    Quest Bars blogesaurus

    Here is my web page: quest bars free sample

    ReplyDelete