Board logo

标题: [注册表类] [已解决]Reg命令修改二进制注册表中一处值 [打印本页]

作者: kdXiaoyi    时间: 2022-7-23 00:03     标题: [已解决]Reg命令修改二进制注册表中一处值

本帖最后由 kdXiaoyi 于 2022-7-23 12:26 编辑

就是图中框选的一处


如果没图烦请图床:https://sm.ms/image/R72XmFqKPfVWkwH

太大了上传不了

求个思路,因为其它部分的值是不定的,不能暴力重写

====================================已由2楼大神解决,十分感谢!
贴出我修改后(加注释)的代码
  1. @echo off
  2. set byte=03
  3. rem 01=任务栏上 03=任务栏下
  4. for /f "tokens=1-2*" %%A in ('reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings^|find /i "Settings"') do (
  5.   rem 列出指定注册表2进制的全部数据并储存进变量
  6.   set settings=%%C
  7. )
  8. echo 原先:%settings%
  9. rem 拼凑变量中第25-26字符处数据
  10. set settings=%settings:~0,24%%byte%%settings:~26%
  11. echo 将改为:%settings%
  12. reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings /t REG_BINARY /d %settings% /f
  13. echo 现在数据:
  14. reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings |find /i "Settings"
  15. pause
复制代码

作者: flashercs    时间: 2022-7-23 07:48

  1. @echo off
  2. set byte=D5
  3. for /f "tokens=1-2*" %%A in ('reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings^|find /i "Settings"') do (
  4.   set settings=%%C
  5. )
  6. echo %settings%
  7. set settings=%settings:~0,24%%byte%%settings:~26%
  8. echo %settings%
  9. reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings /t REG_BINARY /d %settings% /f
  10. pause
复制代码





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