MOTOBIT.COM - ASP upload, IIS utility SetValue Method of Value class

Method | Member of  RegEdit.Value | Changes | Purchase | Download

Description

Sets valueand type to the specified registry value name.

Syntax

Value.SetValue (Value as Variant, [Type as ValueType = (According to value)])
 

Where Type Optional Default Description
 Value  Variant     Value to be stored with the specified registry value name. 
 Type  ValueType  yes  (According to value)  The type of information to be stored in registry. 

Remarks

Use SetValue Method instead Value property to specify exact type (vtExpandString, vtBinary, ...) for the registry value.

Examples

Set values by Value property and SetValue method

  'Get RegEdit.Server object
  Set S = CreateObject("RegEdit.Server")
  
  'Get a key
  Set Key = S.GetKey("HKLM\SOFTWARE\MyFirstKey")

  'Add a new key
  Set MyKey = Key.CreateKey("MyFirstKey")
  'or Set MyKey = Key.SubKeys.Add("MyFirstKey")
  
  'Set String and DWORD values
  MyKey.Values("Path") = "C:\Program Files\My"
  MyKey.Values("Timeout") = 250
  'Set binary value - type exactly specified
  MyKey.Values("BinaryData").SetValue ChrB(65) & ChrB(0) & ChrB(66) & ChrB(0), vtBinary
  'Set MultiString value - type exactly specified
  MyKey.Values("MultiString").SetValue "First String" & Chr(0) & "SecondString", vtMultiString
  'Set ExpandString value - type exactly specified
  MyKey.Values("DLLPath").SetValue "%Windir%\System32\My.DLL", vtExpandString

  'Set value of the vtDWordBigEndian type
  MyKey.Values("BigEndian").SetValue &H11223344, vtDWordBigEndian

See also

Value.Value

Other links for SetValue

Methods of Value class

Binary, Delete, Key, SetValue

Properties of Value class

Expanded, Name, Type, Value

RegEdit.Value

Represents one value from windows registry

RegEdit

Intuitive, easy to use COM interface to windows registry. Set of classes to read/enumerate/modify windows registry keys and values from ASP, VBS and T-SQL.

© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail: info@pstruh.cz