VBS script to move registry keys
Wondering if any body can help. I'm trying to find a vbs script that can compare HKCU keys and automatically move them into the HKLM if they are the same.
We used to use a macro that did this with our old copy of Wise. I know that all HKCU keys are not the same but what i'm trying to do is write a script that i can excute to compare what keys repackaged (if any) are writing to the HKCU hive, to minimize the work of manually checking each key individually.
We don't do any user based installations for Windows 7 x64 packaging so ideally we would like to run something like this to stream line our process and put any duplicate keys into the HKLM hive.
Community Chosen Answer
If they are same then why do you want to move them again to HKLM.. You can just delete the HKCU entries if they are already present in HKLM..
You can write a VBScript using Windows Installer object..
Select 'Key', 'Name', 'Value' from Registry WHERE 'Root'="1"
Select 'Key', 'Name', 'Value' from Registry WHERE 'Root'="2"
Compare them... If they are same then remove the row WHERE 'Root'="1"
You can put this in loop...