No announcement yet.

Unable to read a registry key value

  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to read a registry key value

    I need some help here, I am trying to perform a registry-read and can't seem to be able to obtain data from a value name.

    HKLM\Software\XXX Abbsxs\ABC\Xxared Cxxxx\Xn Xxxss Xxxxxabr\Xxxld\Xrnet Ylter\Fopxxl Xxxxxns

    The value name is xXnable and its data should be either 0 or a 1.
    Displaying the variable afterwards it has always 0. I also get the errors that it could not read from the registry and could not read value. Admin. permissions are given. Further, the key will always exist on all PCs, the determining factor is the value, it will either be 0 or a 1.
    Suggestions are welcome.

  • #2
    Re: Unable to read a registry key value

    Read in another message that the activity that I am trying to perform does not work, apparently a bug that remains with SF latest version. Is there a time frame for an update?

    Reference: Re: Problem with reading from registry [re: madmax]. Date: 11/01/02.


    • #3
      Re: Unable to read a registry key value

      I doubt that the bug applies to you. The bug only affects REG_MULTI_SZ keys. Your key should be REG_DWORD - 4 byte numeric (but may be REG_SZ - fixed length string). If it does apply you why would you be using a REG_MULTI_SZ for a value that should be REG_DWORD.

      With that out of the way try the following:

      1) Verify the data type of the key in Regedit
      2) Test for the existence of the key (Set variable to TRUE),
      3) For debuging purposes show the results of the variable from #2.
      4) Within IF statement for #2 get the value of the key.
      5) For debuging purposes show the results of the variable from #4.


      • #4
        Re: Unable to read a registry key value

        Thank you for the reply and yes the registry (value name) that I am trying to read (value data) from is a DWORD value, more to the point the data notation is hex or decimal (a 0 or a 1). Indeed the bug may not be applicable to this situation, but not entirely sure at this point.

        To address your outlined steps: The Key does exist and has a value of 1.
        Using the "true" option, the IF operation/condition works.
        But, the goal is to read the key value, so far it remains 0. It should be 1.

        If you have other suggestions I will be more than happy to entertain. Meanwhile I have implemented an old trick: when run for the first time I copy a marker file to the distribution, the next time I test for its presence.


        • #5
          Re: Unable to read a registry key value

          In a couple of tests that I performed that were similar type Registry actions, I couldn't replicate any problems on my end.

          I first just want to make sure you are using the latest build of the product which is You can find build details under HELP->ABOUT SETUP FACTORY.

          What do you have as your default value to be returned if the action fails?

          Are there any spaces in the Value name that you have defined? I see you used quotes in your post, however I assumed that you did not include them in the Value field, is that correct?

          If you like, I could take a look at your project file or action script to see if I can see anything visibly wrong. You can send it to our support address if you like.


          • #6
            Re: Unable to read a registry key value

            Hello, getting back to this issue, today I started a new project and have the same problem as before, that is, unable to obtain value data from a reg. setting.
            I have added the pertinent code below. Any help is appreciated.

            START: Perform action: Read from Registry
            Variable name = %VS7%
            Default value = FALSE
            Main key = HKEY_LOCAL_MACHINE
            Sub key = SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\VIRUSCAN7000
            Value name = Version 7.0.0
            TRUE if exists = FALSE
            Auto-expand if REG_EXPAND_SZ = TRUE
            (On Error) User notification mode = None
            (On Error) Action = Continue
            Result = 2
            END: Perform action: Read from Registry

            Here is the reg. key.

            [HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\VIRUSCAN7000]

            Thank you.


            • #7
              Re: Unable to read a registry key value

              It's hard to tell from your post what you have in your Registry. The last part of your post has "Version"="7.0.0". Is this the exact text you have as your Value for that key? Are there quotes listed, spaces etc? The text will need to be exact, so any discrepancy will cause it to fail. Then the data is 1 in decimal for that DWORD value?

              If you are still having problems, email me your project file along with the exported Registry key so I can test on my end. You can email it to [email protected]


              • #8
                Re: Unable to read a registry key value

                I found my problem. It is the way I am entering what is to be read, that is there is no need for me to enter the actual key value, since it can change. I do need to read the value though.

                For value I had: Version=7.0.0
                Now for value I have: Version and nothing else. Performing If- tests I can obtain the actual value of 7.0.0 from the variable (VS7).

                Darryl, I appreciate the help.


                • #9
                  Re: Unable to read a registry key value

                  We're happy to hear you found the source of your problems.