I am trying to finish a more advanced deployment/maintainence user interface to apply the registry tweaks I have compiled over the years.
As you know, many registry tweaks are made to be applied to certain areas of the registry which apply to all users, (such as HKEY_CLASSES_ROOT) while some can either be applied to the local machine (HKEY_LOCAL_MACHINE) or to individual users (HKEY_CURRENT_USER)
I have previously used WIHU to script the importing of .reg files to the registry using regedit /s "regfilename" however what I would like to accomplish is a way to apply tweaks to the CURRENT_USER account the first time a user logs in on a computer. (allowing computer wide settings to take effect while leaving the LOCAL_MACHINE hive intact) This would allow a new fresh user account to be created in the event of user profile corruption without having to rebuild the LOCAL_MACHINE hive.
I am planning on implementing this with the following:
Use WIHU to import any checked tweaks that effect the LOCAL_MACHINE or CLASSES_ROOT directly
Using WIHU to copy the desired CURRENT_USER .reg files to a directory on the local HD
Using this script to execute all .reg files in the directory
CODE
@echo off
echo Importing Default User registry keys...
for /f %%i IN ('dir /b .\files\regkeys\*.reg') DO regedit /s .\files\regkeys\%%i
echo -completed
echo Importing Default User registry keys...
for /f %%i IN ('dir /b .\files\regkeys\*.reg') DO regedit /s .\files\regkeys\%%i
echo -completed
I would trigger the execution of the CURRENT_USER scipt with an entry in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run to run the tweaks at EVERY login
I was going to use a registry key check for the situation where you want the tweaks run only the first time a new user logs in (For the case where you want a preinstalled environment, but you want new users to be able to make changes later without those changes being overwritten) The script would set a registry flag once the tweaks were applied the first time, and close silently in the future.
My main questions relate to wheither this is the most elegant and maintainable meathod to accomplish this.
I have considered using an autoit script to accomplish this as well, or using variables in WIHU to substitute the CURRENT_USER or LOCAL_MACHINE part of the registry path, however I would believe this would require using the REG comand instead of regedit /s (and would do away with having to have a separate version of each .reg file for the local machine and current user)
Are there people out there using REG in their WIHU ini files successfuly instead of regedit /s? There are some visual basic functions such as REGWRITE availible as well; is it possible to call this from WIHU?
I hope some of you with more extensive registry or autoit experience will have some useful comments; till then I will be testing the above registry flag method and will try to compile some more useful snippets in this thread.