还是考虑复杂点:- @echo off
- for %%a in (a b c d e) do (
- if "%%a" equ "a" (
- (for /f "delims=" %%b in ('findstr /n .* %%a\msg.txt') do (
- set "str=%%b"
- setlocal enabledelayedexpansion
- set "str=!str:*:=!"
- if defined str set "str=!str:3307=3306!"
- echo,!str!
- endlocal
- ))>$
- move $ %%a\msg.txt
- ) else (
- copy /y a\msg.txt %%a\
- )
复制代码
|