- @echo off
- set file="1.txt"
- set "old=FFFFFFFFFF"
- set "new=别的字符"
-
- (for /f "delims=" %%a in ('findstr /n .* %file%') do (
- set var=%%a
- setlocal enabledelayedexpansion
- if "!var:%old%=!" neq "!var!" (
- set var=!var:*:=!
- echo;!var:%old%=%new%!
- ) else echo;!var:*:=!
- endlocal
- ))>.new
-
- copy %file% %file%.backup>nul
- move .new %file%
- start "" %file%
复制代码
|