Jump to content

Applying Registry Tweaks with WIHU to Users or Local Machine


mike_jrt

Recommended Posts

Thanks to everyone who has contributed to WIHU and made the MSFN forumns such a great resource!

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

@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

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.

Edited by mike_jrt
Link to comment
Share on other sites


I think if you want extend WIHU, you should add specific internal commands for registry supported as I propagated it once instead of working with .reg registry files.

Like this:

@registry add hklm:/software/test
@registry set hklm:/software/test,myvalue

or in XML

<operation command="@registry" name="..." internal="true">
<argument name="key" value="hklm:/software/test" />
<argument name="set" value="hklm:/software/test,myvalue" />
</operation>

And add support for config file inclusion, and of course xml based config files like:

<include file="regtweak.xml" name="registry Tweaks" />

However I think, autoit or similar will do it.

Benjamin Kalytta

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...