getRegistryValue        package:SWinRegistry        R Documentation

_V_a_l_u_e _o_f _a _K_e_y _i_n _t_h_e _W_i_n_d_o_w_s _r_e_g_i_s_t_r_y

_D_e_s_c_r_i_p_t_i_o_n:

     Get the value of a specific, individual key in the registry. This
     key is assumed to have a value rather than being  merely a
     container key for other sub-keys.

_U_s_a_g_e:

     getRegistryValue(path, key, isError = TRUE, top = .BuiltinKeys[1])

_A_r_g_u_m_e_n_t_s:

    path: the path to the specified node in which the actual key is
          located.  The path can be specfied in a variety of ways. It
          can be a single string with nodes in the path separated by
          the \\ character (e.g. 'Control Panel\\Appearance\\Schemes').
          Alternatively, it can be given as a character vector
          containing the elements of the path as individual elements of
          the character vector. This separates the elements of the path
          in the same way that the  \\ character does. In either cases,
          the top-level key can be specified within this path or
          alternatively can be given  by the 'top' argument. Using the
          'top' argument makes it easier to use the built-in keys in
          the registry. And one can specify these by partial matching
          of the names or by numeric index into the '.BuiltinKeys' 
          vector. 

     key: the name of the key whose value is to be retrieved. If this
          is not specified, the key is taken to be the last element of
          path.

 isError: a logical value that indicates whether to throw an error if
          the key does not exist, or simply return a missing value.
          This allows the caller to avoid having to first check if the
          key exists or handle the error with a call to 'try'. 

     top: the identifier of the top-level key in which to resolve  the
          'path' argument. This can be omitted if the top-level node is
          included in the 'path' argument. This can be a name that
          partially matches those in the '.BuiltinKeys' vector or
          alternatively     the index of the entry in this vector. This
          is used as a convenience interface to minimize typing. 

_D_e_t_a_i_l_s:

     This calls the C-level API routine  'RegQueryValueEx'. The
     conversion from the registry value to an S object is done
     according to the following mapping of the types:

_V_a_l_u_e:

     The value from the key converted to an S object.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang <duncan@wald.ucdavis.edu>

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.omegahat.org/SWinRegistry>

_S_e_e _A_l_s_o:

     'getRegistryKeyValues' 'getRegistrySubKeyNames'

     '.resolveToplevelRegistryKey'

_E_x_a_m_p_l_e_s:

      getRegistryValue("Control Panel\\Current", "Color Schemes", top = "HKEY_CURRENT_USER")

      setRegistryValue("HKEY_CURRENT_USER\\Volatile Environment\\duncan", value = "foobar")
      getRegistryValue("HKEY_CURRENT_USER\\Volatile Environment", "duncan")

     ## Not run: 
     getRegistryValue("SNormal\CLSID\")
     [1] "{C484D2F9-21F5-49AC-8C8D-2007E12245D3}"
     getRegistryValue("SNormal\CLSID", "")
     [1] "{C484D2F9-21F5-49AC-8C8D-2007E12245D3}"
     getRegistryValue(c("SNormal", "CLSID"), "")
     [1] "{C484D2F9-21F5-49AC-8C8D-2007E12245D3}"
     getRegistryValue(c("SNormal", "CLSID", ""))
     [1] "{C484D2F9-21F5-49AC-8C8D-2007E12245D3}"
     ## End(Not run)

