通过批处理文件更改其他用户的注册表 [英] Changing other user's registry through batch files

查看:1576
本文介绍了通过批处理文件更改其他用户的注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改其他用户的其他管理员帐户 HKCU 注册表?

Is it possible to change other user HKCU registry from other admin account?

我的工作流程是:


  1. 安装的管理员帐户的软件。

  2. 安装用户创建CustomUser

  3. 我需要设置一些注册表项,该用户...

我能够通过命令ProfileList文件创建注册表项:

I am able to create registry keys in ProfileList through command:

%windir%\System32\runas.exe /profile /user:domain\%targetUser% logonui.exe

但是,这并不在 HKEY_USERS

我也试过模拟中所描述:的http://www.$c$cproject.com/Articles/124981/A-Complete-Impersonation-Demo-in-C-NET

I also tried impersonation through C# described in : http://www.codeproject.com/Articles/124981/A-Complete-Impersonation-Demo-in-C-NET

但此行抛出异常:布尔loadSuccess =
                                LoadUserProfile(tokenDuplicate,楼盘profileInfo);

我理想的方式是改变只是批处理文件注册表中。

Ideal way for me is to change registry just in batch file.

推荐答案

无论是确定了CustomUserSID事先和访问港大通过的路径,解析REG.EXE /直接添加命令到配置文件。

Either determine the 'CustomUser' SID beforehand and access it through HKU path, parsing reg.exe /add commands directly to the profile.

实例SID

HKEY_USERS\S-1-5-21-818888881-78888889-18888888-1000

或装入NTUSER.DAT,避免SID busiesss。

or mount the NTUSER.DAT and avoid the SID busiesss.

REG LOAD HKU\ZZZ "C:\Documents and Settings\CustomUser\NTUSER.DAT"
REG ADD HKU\ZZZ\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v newUserProfile /t REG_EXPAND_SZ /d "D:\setup.cmd" /f
REG UNLOAD HKU\ZZZ

编辑,这里是如何找到你的WMIC SID CustomUser

EDIT, here is how to find your CustomUser SID from WMIC.

wmic useraccount where name='CustomUser' get sid

这篇关于通过批处理文件更改其他用户的注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆