回 帖 发 新 帖 刷新版面

主题:[讨论]如何修改注册表?有具体的键和键值!

以下是用软件得到的结果,想用VB修改注册表的键和键值,我试了一下不行啊!有谁帮我一下!谢谢!

增加键:10 
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft\Windows
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft\Windows\CurrentVersion
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft\Windows\CurrentVersion\Policies
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun 

增加值:15 
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\Options: 0x00000000
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\Version: 0x00060006
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\DSPath: "LocalGPO"
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\FileSysPath: "C:\WINDOWS\System32\GroupPolicy\User"
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\DisplayName: "Local Group Policy"
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\Extensions: "[{35378EAC-683F-11D2-A89A-00C04FBBCFA2}{0F6B957E-509E-11D1-A7CC-0000F87571E3}]"
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\Link: "Local"
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\GPOName: "Local Group Policy"
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\GPOLink: 0x00000001
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0\lParam: 0x00000000
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun\**delvals.: " "
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun\1: "AdBalloonext.exe"
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{E463D078-5367-47E2-87D1-7008FD4BEA94}User\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun: 0x00000001
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun: 0x00000001
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun\1: "AdBalloonext.exe"

修改值:12 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\Extension-List\{00000000-0000-0000-0000-000000000000}\StartTimeLo: 0xFD20E108
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\Extension-List\{00000000-0000-0000-0000-000000000000}\StartTimeLo: 0x5DA24FAC
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\Extension-List\{00000000-0000-0000-0000-000000000000}\StartTimeHi: 0x01C93106
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\Extension-List\{00000000-0000-0000-0000-000000000000}\StartTimeHi: 0x01C93108
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\Extension-List\{00000000-0000-0000-0000-000000000000}\EndTimeLo: 0xFD4E2DB6
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\Extension-List\{00000000-0000-0000-0000-000000000000}\EndTimeLo: 0x5DC14E3E
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\Extension-List\{00000000-0000-0000-0000-000000000000}\EndTimeHi: 0x01C93106
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\Extension-List\{00000000-0000-0000-0000-000000000000}\EndTimeHi: 0x01C93108
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\GPO-List\0\Version: 0x00050005
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\S-1-5-21-1338636718-1456466862-2406628963-1003\GPO-List\0\Version: 0x00060006
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability\LastAliveUptime: 0x00001F78
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability\LastAliveUptime: 0x00001FB4
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability\LastAliveStamp: D8 07 0A 00 06 00 12 00 09 00 3B 00 14 00 9C 00
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability\LastAliveStamp: D8 07 0A 00 06 00 12 00 0A 00 00 00 14 00 9C 00
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\kl1\InData: 94 71 0A 12 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\kl1\InData: 38 72 0A 12 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\kl1\OutData: 44 58 AE 00 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\kl1\OutData: 4A 59 AE 00 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kl1\InData: 94 71 0A 12 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kl1\InData: 38 72 0A 12 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kl1\OutData: 44 58 AE 00 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kl1\OutData: 4A 59 AE 00 00 00 00 00
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\LastPolicyTime: 0x00E71E0E
HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\LastPolicyTime: 0x00E71E18

回复列表 (共4个回复)

沙发

请问你是怎么试的

板凳

[quote]请问你是怎么试的[/quote]
怎么试的,和我的问题有关系吗?
就是没应用计算机命令之前,先用软件读注册表,然后在应用计算机命令后在用软件读注册表,最后比较一下!得出的结果不就是想要设置命令后的键值吗?

3 楼

你说有没有关系?

如果你只想要答案,我也可以告诉你,三个API直接写入,但你要有足够权限。如果你想知道怎么写程序,我也可以告诉你,去看API怎么操作注册表。

但如果你要代码,嘿嘿,有点难度。因为你的问题不是搜索引擎搜索不到答案。只要你想学,而没得到你想要的结果,大家都会帮忙,这里的人都很热心。API操作注册表,我也刚刚试过,而且也成功了。

现在的社会,要吃白饭,难啊

4 楼

修改注册表可以有多种办法,其中一个办法是把修改内容写为reg文件,再用 Shell 函数导入注册表。例如,D盘上有一个reg文件,它的内容如下:

Windows Registry Editor Version 5.00   '这是文件头,XP/2003 等操作系统的reg文件均以此开头

[HKEY_CLASSES_ROOT\CLSID\{0CF774D0-F077-11D1-B1BC-00C04F86C324}\InprocServer32]
@="C:\\WINDOWS.0\\System32\\scrrun.dll" '这是修改默认项的值,默认项是以“@”为标记的,默认项一般都是字符型的
"ThreadingModel"="Apartment"


那么你就用下面的语句将其导入注册表:

Shell "regedit.exe /s D:\1.reg", 0

这个办法适合要修改的注册表项很多的情况,也就是你所说的情况,但是要注意reg文件的格式必须符合规定。
以你的例子来说,增加键的格式(注意方括号):


[HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}]

修改或增加值的格式:

[HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0]
"Options"=dword:0 '这是双字节数据,16进制

[HKEY_USERS\S-1-5-21-1338636718-1456466862-2406628963-1003\Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\0]
"DSPath"="LocalGPO" '这是字符型数据

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability]
"LastAliveStamp"=hex: D8,07,0A,00,06,00,12,00,09,00,3B,00,14,00,9C,00 '这是二进制数据(实际上也是16进制),用逗号分隔


你自己再琢磨一下吧

我来回复

您尚未登录,请登录后再回复。点此登录或注册