Results 1 to 4 of 4

Thread: [Resolved]If RegRead = Error then

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    74

    Resolved [Resolved]If RegRead = Error then

    Hi
    so I searched & searched & all i found was loads of code that simply does not work so hire i am. I want to see if this folder exists in my registry. I know it does nt exists actually & i get error hire & im stuck. so can someone be so kind & help me out? this is what I want to do.

    Code:
           Dim objShell
            objShell = CreateObject("WScript.Shell")
            If objShell.RegRead("HKEY_CURRENT_USER\Software\_MyScripts\Alarm\") = Error Then
                MessageBox.Show("Boo")
            Else
                MessageBox.Show("Bingo")
            End If

    Edit: For some reason i cant post so Ill edit:

    That code of yours Icyculyr does not actually work, it outputs always bingo=folder exists even if it does not eexist. But that aside, that My.Computer.Registry.GetValue was really helpful & i figured it out. Thanx.

    Code:
        Dim readValue As Object
            readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\_MyScripts\Alarm", "Min_combo", Nothing)
    
            If CStr(readValue) = "" Then
                MessageBox.Show("boo")
            Else
                MessageBox.Show("Bingo")
            End If
    Last edited by goldenix; Apr 3rd, 2008 at 09:21 PM.

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