本帖最后由 e98123 于 2019-2-28 08:15 编辑
set REGFILE=a.reg
set KEYNAME=HKEY_CURRENT_USER\Environment
echo Windows Registry Editor Version 5.00>%REGFILE%
echo [%KEYNAME%]>>%REGFILE%
reg export "%KEYNAME%" export.bak
type export.bak|find /i """TEMP""">>%REGFILE%
1、以上export.bak导出的内容为:
[HKEY_CURRENT_USER\Environment]
"TEMP"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
00,45,00,25,00,5c,00,4c,00,6f,00,63,00,61,00,6c,00,20,00,53,00,65,00,74,00,\
74,00,69,00,6e,00,67,00,73,00,5c,00,54,00,65,00,6d,00,70,00,00,00
"TMP"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,00,\
45,00,25,00,5c,00,4c,00,6f,00,63,00,61,00,6c,00,20,00,53,00,65,00,74,00,74,\
00,69,00,6e,00,67,00,73,00,5c,00,54,00,65,00,6d,00,70,00,00,00
2、取TEMP后,在a.reg中只能得到:(只有1行)
"TEMP"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
3、请问有什么方法可以完整地得到:(完整3行)
"TEMP"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c,\
00,45,00,25,00,5c,00,4c,00,6f,00,63,00,61,00,6c,00,20,00,53,00,65,00,74,00,\
74,00,69,00,6e,00,67,00,73,00,5c,00,54,00,65,00,6d,00,70,00,00,00
PS:
打算做一个注册表修改的玩意,安装时备份导出原来的设置,卸载时再导入备份时的设置,直接导入注册表REG文件比较方便,不打算使用reg add方法。 |