中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-04 17:21
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to automatically find a certain registry key value
Printable Version  830 / 3
Floor1 lzys Posted 2007-05-23 04:01
初级用户 Posts 28 Credits 54
I want to modify the registry
HKEY_USERS\S-1-5-21-746137067-602162358-725345543-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Lockdown_Zones\0
"DisplayName"="my own name"

But this key value seems to be different on every system... How should I write it so it can automatically find this key value????? Please help, experts

[ Last edited by lzys on 2007-5-23 at 04:21 AM ]
Floor2 bjsh Posted 2007-05-23 09:48
银牌会员 Posts 621 Credits 2,000
Try this, see if it works:
Because S-1-5-21-746137067-602162358-725345543-500 is different on every computer;
I get it with 'reg query HKU^|findstr /v "_Classes"^|findstr "S-1-5-21"';
it should have pretty good compatibility; but I haven't tested it;


Here I'm only doing reg query and not modifying it;

If you want to modify it;
refer to the above code and reg /? and make the changes yourself.
Floor3 lzys Posted 2007-05-23 15:47
初级用户 Posts 28 Credits 54
I'm dizzy now, maybe I'm just too dumb. I studied it for quite a while and still couldn't complete the code after that... Moderator, please help again... after v DisplayName I really don't know what code to add
Floor4 bjsh Posted 2007-05-23 16:04
银牌会员 Posts 621 Credits 2,000
Take a look at reg add /?
Change my reg query to reg add, as for the format refer to the following;

Windows Console Registry Tool - Version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved.


REG ADD KeyName

KeyName FullKey
Remote machine name - omitted defaults to the current machine.
On remote machines only HKLM and HKU are available.
FullKey ROOTKEY\SubKey
ROOTKEY
SubKey The full name of the registry key under the selected ROOTKEY

/v The value name to add under the selected key

/ve Adds an empty value name <No Name> to the registry key

/t RegKey data type



If omitted, REG_SZ is assumed

/s Specifies a character to use as the separator
in a REG_MULTI_SZ data string
If omitted, "\0" is used as the separator

/d The data to assign to the registry ValueName being added

/f Force overwriting the existing registry entry without prompting
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023