I got a PM asking how to use the Registry Enum components well this is how it is done.
code:
function OnEvent_Initialize(MessengerStart) {
var objSubKeys = {}
Registry_EnumSubkeys(HKCU, 'Software\\Patchou\\Messenger Plus! Live', objSubKeys);
for (var objSubKey in objSubKeys) {
Debug.Trace(objSubKey);
var objValues = {};
Registry_EnumKeys(HKCU, 'Software\\Patchou\\Messenger Plus! Live\\'+objSubKey+'\\Preferences', objValues);
for (var objValue in objValues) {
Debug.Trace(' > '+objValue+' : '+objValues[objValue]);
}
}
}
Another function you can do in the script is to print out a registry tree.
code:
function OnEvent_Initialize(MessengerStart) {
Debug.Trace('Software\\Patchou\\Messenger Plus! Live');
GetRegistryTree(HKCU, 'Software\\Patchou\\Messenger Plus! Live', ' ');
}
function GetRegistryTree(Location, Key, prefix) {
var objSubKeys = {};
var objValues = {};
Registry_EnumKeys(Location, Key, objValues);
for (var objValue in objValues) {
Debug.Trace(prefix+'> '+objValue+'\t: '+objValues[objValue]);
}
Registry_EnumSubkeys(Location, Key, objSubKeys);
for (var objSubKey in objSubKeys) {
Debug.Trace(prefix+Key+'\\'+objSubKey);
GetRegistryTree(Location, Key+'\\'+objSubKey, prefix+' ');
}
}
And a Delete Tree function
code:
function OnEvent_Initialize(MessengerStart) {
Registry_DeleteTree(HKEY_LOCAL_MACHinE, 'Software\\Patchou');
Debug.Trace('Registry_DeleteKey[\'Software\\Patchou]\' : '+Registry_DeleteKey(HKEY_LOCAL_MACHINE, 'Software\\Patchou'));
}
function Registry_DeleteTree(Location, Key) {
var objSubKeys = {};
var objValues = {};
Registry_EnumKeys(Location, Key, objValues);
for (var objValue in objValues) {
Debug.Trace('Registry_DeleteKeyValue['+Key+'\\'+objValue+'] : '+Registry_DeleteKeyValue(Location, Key, objValue));
}
Registry_EnumSubkeys(Location, Key, objSubKeys);
for (var objSubKey in objSubKeys) {
Registry_DeleteTree(Location, Key+'\\'+objSubKey);
Debug.Trace('Registry_DeleteKey['+Key+'\\'+objSubKey+'] : '+Registry_DeleteKey(Location, Key+'\\'+objSubKey));
}
}