+ Reply to Thread
Results 1 to 2 of 2

Reading the Registry

Hybrid View

Guest Reading the Registry 03-05-2005, 06:06 PM
Guest Re: Reading the Registry 03-06-2005, 06:06 AM
  1. #1
    JK
    Guest

    Reading the Registry

    I would like my application to read the registry each time it opens to
    confirm that "HKEY_CURRENT_USER\Software\[my application]\[my RegEntry]
    exists. I read JW's explanation but am struggling to make it fit my purpose:
    If [my RegEntry] exists, then open application, else MsgBox "Sorry" close
    application. Can someone please advise.

    Thank you.
    Jim Kobzeff



  2. #2
    Bob Phillips
    Guest

    Re: Reading the Registry

    Here is an example

    Dim oWSH As Object
    Dim sResult

    Set oWSH = CreateObject("WScript.Shell")


    On Error Resume Next

    sResult = oWSH.RegRead("HKCU\Software\myApp\myKey\")
    If Err.Number <> 0 Or sResult = "" Then
    MsgBox "No valid key"
    Me.Close savechanges:=False
    End If
    Err.Clear

    On Error GoTo 0



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "JK" <JK@here.com> wrote in message news:4OpWd.25746$QQ3.1671@trnddc02...
    > I would like my application to read the registry each time it opens to
    > confirm that "HKEY_CURRENT_USER\Software\[my application]\[my RegEntry]
    > exists. I read JW's explanation but am struggling to make it fit my

    purpose:
    > If [my RegEntry] exists, then open application, else MsgBox "Sorry" close
    > application. Can someone please advise.
    >
    > Thank you.
    > Jim Kobzeff
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1