标题: [注册表类] [已解决]Reg命令修改二进制注册表中一处值 [打印本页]
作者: kdXiaoyi 时间: 2022-7-23 00:03 标题: [已解决]Reg命令修改二进制注册表中一处值
本帖最后由 kdXiaoyi 于 2022-7-23 12:26 编辑
就是图中框选的一处
如果没图烦请图床:https://sm.ms/image/R72XmFqKPfVWkwH
太大了上传不了
求个思路,因为其它部分的值是不定的,不能暴力重写
====================================已由2楼大神解决,十分感谢!
贴出我修改后(加注释)的代码
- @echo off
- set byte=03
- rem 01=任务栏上 03=任务栏下
- for /f "tokens=1-2*" %%A in ('reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings^|find /i "Settings"') do (
- rem 列出指定注册表2进制的全部数据并储存进变量
- set settings=%%C
- )
- echo 原先:%settings%
- rem 拼凑变量中第25-26字符处数据
- set settings=%settings:~0,24%%byte%%settings:~26%
- echo 将改为:%settings%
- reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings /t REG_BINARY /d %settings% /f
- echo 现在数据:
- reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings |find /i "Settings"
- pause
复制代码
作者: flashercs 时间: 2022-7-23 07:48
- @echo off
- set byte=D5
- for /f "tokens=1-2*" %%A in ('reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings^|find /i "Settings"') do (
- set settings=%%C
- )
- echo %settings%
- set settings=%settings:~0,24%%byte%%settings:~26%
- echo %settings%
- reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings /t REG_BINARY /d %settings% /f
- pause
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |