Board logo

标题: [注册表类] Reg文件的二进制值,怎么改为Reg.exe格式的批处理?谢谢! [打印本页]

作者: Shuye    时间: 2023-3-16 18:36     标题: Reg文件的二进制值,怎么改为Reg.exe格式的批处理?谢谢!


这是 .reg 文件里的内容,二进制值

Windows Registry Editor Version 5.00
[HKEY_USERS\.DEFAULT\Console]
"F"=hex:03,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,ff,ff,ff,ff,ff,ff,ff,7f,00,00,00,00,00,00,00,00,\
  f4,01,00,00,01,02,00,00,10,02,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,\
  00,65,00,00,00,0c,00

想改写成 Reg.exe 格式,应该怎么写?

谢谢!

作者: Lewime    时间: 2023-3-16 23:42

reg add "HKU\.DEFAULT\Console" /v "F" /t REG_BINARY /d "0300010000000000000000000000000000000000000000000000000000000000ffffffffffffff7f0000000000000000f401000001020000100200000000000000000000010000000000650000000c00" /f
作者: Shuye    时间: 2023-3-17 00:32

回复 2# Lewime

测试通过,谢谢 Lewime 兄!

作者: Shuye    时间: 2023-3-17 00:33


只是,那串数值太长,想分成几行,

Set "RegData=0300010000000000000000000000000000000000000000"
Set "RegData=%RegData%000000000000000000ffffffffffffff7f0000000000000000"
Set "RegData=%RegData%f4010000010200001002000000000000000000000100000000"
Set "RegData=%RegData%00650000000c00"
Reg add "HKU\.DEFAULT\Console" /v "F" /t REG_BINARY /d "%%RegData%%" /f

结果报错:
错误: 无效语法。为 '/d' 指定有效十六进制值。

能用变量代替么?

作者: Batcher    时间: 2023-3-17 09:32

回复 4# Shuye


    试试把%%RegData%%改成%RegData%
作者: Shuye    时间: 2023-3-17 12:55

回复 5# Batcher

测试成功,谢谢 Batcher 兄!





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2