注册表文件不是特别大的话,可以试试纯批方案- @echo off
- set "pth=%~dp0"
- set "pth=%pth:~,-1%"
- set "pth=%pth:\=\\%"
- (for /f "delims=" %%a in ('find /n /v ""^<a.reg') do (
- set "str=%%a"
- setlocal enabledelayedexpansion
- set "str=!str:X:\\Program Files\\7-Zip=%pth%!"
- set "str=!str:*]=!"
- echo,!str!
- endlocal
- ))>b.reg
复制代码
|