回复 1# ccw4234312 - @echo off
- REM by szl1123
- REM 注意:添加的内容要换行时请添加“\0”
- REM 设置注册表路径
- set zcb=HKLM\Software\1test
- REM 设置注册表值名
- set zcbzm=zhi
- for /f "tokens=2,*" %%i in ('reg query "%zcb%" /v "%zcbzm%"') do (
- set zhi=%%j
- )
- echo %zhi%>test.txt
- start /wait test.txt
- for /f "delims=" %%k in ('type test.txt') do set zcbz=%%k
- reg add "%zcb%" /f /v "%zcbzm%" /t REG_MULTI_SZ /d "%zcbz%"
- del /f /q test.txt
- pause
复制代码 编辑txt文本时添加的内容如果要换行请添加“\0”
如下图所示 |