本帖最后由 batman 于 2011-5-13 11:39 编辑
请测试后使用:- @echo off&setlocal enabledelayedexpansion
- set "code=这里放你要替换的字符串,每个间用空格格开"
- for %%a in (%code%) do (
- set /a n+=1&set "str=000!n!"
- set "%%a=!str:~-3!_%%a"
- )
- for /r %%a in (*.txt) do (
- (for /f "usebackq delims=" %%b in ("%%a") do (
- set "str=%%b"
- for %%b in (%code%) do (
- for %%c in (!%%b!) do set "str=!str:%%b=%%c!"
- )
- echo,!str!
- ))>$
- move /y $ "%%a"
- )
复制代码
|