Results 1 to 2 of 2

Thread: Read and writing new line to multiline registry string

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    Read and writing new line to multiline registry string

    I've been a bit confused with some of the registry examples I've seen so far...

    Theres a registry string that may or may not exist. If it doesn't I want to add it. I need to check this string and if it does exist I need to write a new line without overwriting the previous data.

    How can I achieve this?

    Sorry if the question is vague.

    Thanks

  2. #2
    Hyperactive Member Chathura's Avatar
    Join Date
    Nov 2005
    Location
    Sri Lanka
    Posts
    345

    Re: Read and writing new line to multiline registry string


    Dim WshShell As Object
    Dim sSection As String

    Set WshShell = CreateObject("WScript.Shell")
    sSection = "HKEY_LOCAL_MACHINE\Software\YourAppName\"
    'Check wheather your string exist
    if WshShell.RegRead(sSection & "DBName")="" then
    'Write to register
    WshShell.RegWrite sSection & "\" & "DBName, "YourString"
    endif

    Set WshShell = Nothing
    If the post is heplful, Please Rate it
    Chathura Wijekoon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width