- @echo off&cd /d "%~dp0"
- rem 编码存为ANSI/GB2312
- >"%tmp%\v.v" echo;Set fso=CreateObject("Scripting.Filesystemobject")
- >>"%tmp%\v.v" echo;Set f=fso.OpenTextFile(WSH.Arguments(0),1)
- >>"%tmp%\v.v" echo;text=f.ReadAll:f.Close
- >>"%tmp%\v.v" echo;If Instr(text,WSH.Arguments(1)) Then
- >>"%tmp%\v.v" echo;Set f=fso.CreateTextFile(WSH.Arguments(0),2)
- >>"%tmp%\v.v" echo;f.Write replace(text,WSH.Arguments(1),WSH.Arguments(2))
- >>"%tmp%\v.v" echo;f.Close
- >>"%tmp%\v.v" echo;End If:WSH.Quit
- for /f "delims=" %%a in ('dir /a-d/b/s *.txt') do (
- echo;"%%a"
- cscript -nologo -e:vbscript "%tmp%\v.v" "%%a" "ABC_D" "BACK go"
- )
- pause
- exit
复制代码
|