Platforms to show: All Mac Windows Linux Cross-Platform

Back to RegistryKeyMBS class.

RegistryKeyMBS.CopyTree(keyname as string, Dest as RegistryKeyMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin 17.4 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Copies the specified registry key, along with its values and subkeys, to the specified destination key.

Returns true on success and false on failure.

RegistryKeyMBS.CreateKey(name as string, Use64bitRegistry as boolean = false) as RegistryKeyMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a new subkey.

If the key is allready present it is just opened.
Returns a registry key or nil on any error.

Use64bitRegistry: Pass true to create key in 64 bit view of the Registry instead of 32 bit view.

Some examples using this method:

RegistryKeyMBS.Delete(keyname as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Deletes the specified subkey key.

Windows 95: The Delete function deletes a subkey and all its descendants.
Windows NT: The Delete function deletes the specified subkey. The subkey to be deleted must not have subkeys.

With plugin version 3.2 the NT behavior is worked around to match the Windows 95 behavior. So all sub keys are deleted!

RegistryKeyMBS.DeleteTree(keyname as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin 17.4 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Deletes the subkeys and values of the specified key recursively.
Example
dim t as RegistryKeyMBS = RegistryMBS.CurrentUser

// create some keys
dim n as RegistryKeyMBS = t.CreateKey("Hello")
dim w as RegistryKeyMBS = n.CreateKey("World")


w.Value("Test").asString = "Hello"

break // see in regedit

// delete it
if t.DeleteTree("Hello") then
MsgBox "deleted. ok"
else
MsgBox "delete failed"
end if

Returns true on success and false on failure.

RegistryKeyMBS.Flush

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Writes all the attributes of the specified open key into the RegistryMBS.

RegistryKeyMBS.Item(index as Integer) as RegistryKeyMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns the key at the specified index.

May return nil on any error like missing access rights.
Some keys can't be opened, but ItemName() may return the name of the key.

See also:

RegistryKeyMBS.Item(name as string) as RegistryKeyMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin 10.4 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns the key with the specified name.

May return nil on any error like missing access rights.
Some keys can't be opened, but ItemName() may return the name of the key.

See also:

RegistryKeyMBS.ItemName(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin 6.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns the name of the key at the specified index.

May return "" on any error.

RegistryKeyMBS.Value(index as Integer) as RegistryValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns the value at the specified index.

See also:

RegistryKeyMBS.Value(name as string) as RegistryValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns the value item with the specified name.

The value must not exists. So use this function to make a new key.
Use an empty name (e.g. "") for the default key value.

This method was named ValueItem in plugin version before 10.4.

See also:

RegistryKeyMBS.ValueName(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows Registry MBS Win Plugin 10.4 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns the name of the value with the given index.

May return "" on any error.

Some examples using this method:

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...