modify the user's registry while/after user login

  • Thread starter Thread starter Tino Boss
  • Start date Start date
T

Tino Boss

Once in a while I have a problem that is solved easiest by copying
some registry-vaules (usually user-configuration of newly added
software).

The problem is I don't know how to put these values in the user's
registry (unless doing it manually for every user with regedt32
loading each user's hive and edit there).

Is there a solution with a simple batch file to do so?

I tried batch files with "reg restore" but the user doesn't have the
permissions to run these commands. It will produce an error "a
required privilege is not held by the client" (maybe there's a way to
give users the required permissions?).
I tried runas administrator with reg restore but I guess (hope) there
is no way to provide the admin password automatically.

any suggestions appreciated

Tino
 
The simplest solution, in my opinion, is to merge a .reg file.

regedit /s %logonserver%\file.reg

Ray at work
 
Once in a while I have a problem that is solved easiest by copying
some registry-vaules (usually user-configuration of newly added
software).

The problem is I don't know how to put these values in the user's
registry (unless doing it manually for every user with regedt32
loading each user's hive and edit there).

Is there a solution with a simple batch file to do so?

I tried batch files with "reg restore" but the user doesn't have the
permissions to run these commands. It will produce an error "a
required privilege is not held by the client" (maybe there's a way to
give users the required permissions?).
I tried runas administrator with reg restore but I guess (hope) there
is no way to provide the admin password automatically.

What part of the registry needs to be updated, is it HKey_Current_User
or HKey_Local_Machine? If the latter then Reg.exe can be used to push
changes remotely. The syntax is different for some versions of
Reg.exe. Some have the machine name passed as a parameter at the end,
and some include at the beginning.

HKCU settings should, at least most of them, be modifiable by the
user. Use Regedt32 to see the permissions of the specific keys being
updated. It is possible to update HKCU settings remotely as an
administrator but it is ugly.

Clay Calvert
(e-mail address removed)
Replace "W" with "L"
 
Tino said:
Once in a while I have a problem that is solved easiest by copying
some registry-vaules (usually user-configuration of newly added
software).

The problem is I don't know how to put these values in the user's
registry (unless doing it manually for every user with regedt32
loading each user's hive and edit there).

Is there a solution with a simple batch file to do so?

I tried batch files with "reg restore" but the user doesn't have the
permissions to run these commands. It will produce an error "a
required privilege is not held by the client" (maybe there's a way to
give users the required permissions?).
I tried runas administrator with reg restore but I guess (hope) there
is no way to provide the admin password automatically.

Hi

At least one of the buy-products referenced at
http://groups.google.com/[email protected] can do this
it looks like:

From http://www.netexec.de/

<quote>
Temporary Administrator group memberships

Another feature that make NetExec a excellent choice for software installation
scenarios are extended group memberships. Using this feature it is possible to
run a process under a non-privileged user account, but inside this process the
user becomes also a member of the Administrators group. Therefore the app uses
the profile, settings and home directory of the non-privileged user account,
but
runs with Administrator privileges.
</quote>
 
While the user is logged on, you can modify the HKU key as long as you know
the user's SID.

I use getsid from the resource kit to determine the user's SID, then use
reg.exe (v2) to to a reg add:
\\computername\HKU\<user sid>\subkey...

use reg.exe /? to get the precise commands. Works great in batch.
 
Thanks for all the answers. The solution with the .reg file worked just fine.

Tino
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top