Restore registry key with security settings
Reg format have two problems when you try to import file to registry:
- doesnt contain security settings
- it is using merge instead of replace
This can be sometimes really unwelcomed - for example you want to automatically recreate ODBC settings everytime user logs on. What do you do? You create odbc.reg and automatically import it every time... Wrong! The problem is that if users creates some additional odbc sources, they will stay. Ok, so how can you completely overwrite the key???
In fact it is quite simple - instead of using .reg, you should use hive keys (.hiv). You can do it from regedit or if you prefer console, use Reg.exe instead (with Save/Restore switches).
I used this few times and it is really useful! In hive file, there are also informations about security settings, so you can easily create them.
This is sometimes really useful - hope so that it could help someone fighting with registry ;)