联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off&&setlocal enabledelayedexpansion set path0=%~dp0 set path1=%path0:\=\\% set path2=C:\\Program Files\\Design Explorer 99 SE\\ for /f "delims=" %%i in (a.reg) do ( set x=%%i set t=!x:%path2%=%path1%! echo !t! )
@echo off change a.reg /from "\\" /to "\" /in "C:\\Program Files\\Design Explorer 99 SE\\" change a.reg /from "C:\Program Files\Design Explorer 99 SE\" /to "%~dp0" change a.reg /from "\" /to "\\" /in "%~dp0"
@echo off&&setlocal enabledelayedexpansion set n=0 set path0=%~dp0 set path1=%path0:\=\\% set path2=C:\\Program Files\\Design Explorer 99 SE\\ for /f "delims=" %%i in ('type a.reg') do ( set x=%%i set t=!x:%path2%=%path1%! if !n! equ 1 (echo. >>b.txt) if !n! equ 3 (echo. >>b.txt) if !n! equ 4 (echo. >>b.txt) if !n! equ 6 (echo. >>b.txt) echo !t! >>b.txt set/a n+=1 ) pause
@echo off set puth1=C:\\Program Files\\Design Explorer 99 SE\\ set puth2=%~dp0 set puth2=%puth2:\=\\% for /f "tokens=1* delims=: " %%i in ('findstr /n ".*" a.reg') do ( set str=%%j&set /a n+=1 setlocal enabledelayedexpansion if defined str set str=!str:%puth1%=%puth2%! if !n! equ 1 ( echo.!str!>a.reg ) else ( echo.!str!>>a.reg ) endlocal ) echo 替换完成! pause>nul