Dict2RegistryTree — Write to registry from dict.
Dict2RegistryTree DictValue RegistryRootKey ?DeleteUnmatchedOption?
Return Value
DictValueDictionary value to use to write registry.
RegistryRootKeyRegistry key to begin writing under.
DeleteUnmatchedOptionOptional. Tells whether to delete elements in the registry that are not found in the dict. Defaults to --leave-unmatched (no delete).
More Info
Unless the DeleteUnmatched argument is set, anything already in the registry tree and not in the dict will remain just as it is. You must set DeleteUnmatchedOption to --delete-unmatched in order to make it delete registry elements (values and subtrees) that do not have a corresponding dict element.

If there is no existing registry key, this command will create one.

Note that there is currently no way to specify the type to use for value data. If the registry values already exist then this command will keep them and write data that is of the same type. So, for instance, if a 1 is in the dict value and the registry value has type REG_BINARY then that will be maintained. But if there is no value already in the registry then the command will make a new value of type REG_SZ.

The algorithm used when the delete unmatched option is selected can be improved upon for efficiency and may be changed in a future release.

For information regarding exceptions / errors, see here.
% set MyDict [dict create test 1-2-3]
test 1-2-3
% dict get $MyDict test
% Dict2RegistryTree MyDict {HKEY_CURRENT_USER\Software\GenTest}
% registry get {HKEY_CURRENT_USER\Software\GenTest} test
% registry delete {HKEY_CURRENT_USER\Software\GenTest}
RegistryTree2Dict, dict
conversion, dict, registry