Jump to content

Write in HKCU from other account


Sn00f

Recommended Posts

Hi all,

I would like to know if it exists a tool to change registry settings from an unconnected account:

for example I would like to change a user HKCU setting but I'm loggued as administrator or SYSTEM Account.

OR

Is it possible through script or .cmd file (not the runas command, because it should be without user entry)

because My users can't write into the registry and I would like to, with a script or a special program to launch at startup. (RunOnce)

any ideas?

Link to comment
Share on other sites


hum great interesting!

but how can I extract the pid from the registry and put it into a variable, all that with a script?

For example:

name=user1

pid= S-1-5-21-1605980848-1645125239-839522115-1001

-> get way to user1 (hklm\...)

->user1 pid = S-1-5-21-1605980848-1645125239-839522115-1001

-> insert S-1-5-21-1605980848-1645125239-839522115-1001 into variable

customisation.cmd:

hkey_user\S-1-5-21-1605980848-1645125239-839522115-1001\blablabla

regedit /s bla bla bla

any ideas?->

Link to comment
Share on other sites

Users have rights to their HKCU keys so i dont see what the problem is.

Unless you have a policy where they cannot access regedit and are trying to

import .reg files.

Instead of using .reg file modify your script to use reg add this will allow users to

modify their HKCU keys even with policy restricting regedit.

Link to comment
Share on other sites

Instead of using .reg file modify your script to use reg add this will allow users to

modify their HKCU keys even with policy restricting regedit.

hum I didn't know that.

I have restricted the registry acces to other users, that's why I wanted to inser value into it with administrator or System account...

I have to check reg ADD.....

Link to comment
Share on other sites

Yes

C:\WINDOWS\system32>reg.exe /?

Console Registry Tool for Windows - version 3.0

I have used it with NT4.0 Workstation so I would assume it will work on W2K

Now for what you was asking on how to get USER names

Save as a .vbs file

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Account",,48)
For Each objItem in colItems
   Wscript.Echo "LocalAccount: " & objItem.LocalAccount
   Wscript.Echo "Name: " & objItem.Name
   Wscript.Echo "SID: " & objItem.SID
   Wscript.Echo "SIDType: " & objItem.SIDType
Next

You can modify that simply. You can also read/write to reg with WScript BTW

Edited by maxXPsoft
Link to comment
Share on other sites

thanks a lot!

could you send the "new" reg.exe v3.0?

I tried the .vbs ;but it showed me plenty of little windows (with user name, sid ....)

is it possible to do this just like an "ipn" variable?

for /F "tokens=1 delims=." %%A in ('ipn') do set logname=%%A

echo %logname%: >> t:\Logs\name.txt

for /F "tokens=1 delims=." %%A in ('<vbsscript>') do set pid=%%A

(pid= S-1-5-21-1605980848-1645125239-839522115-1001)

reg add hku\%pid%\blablabla?

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...