就是批量替换文件中的指定字符, 但是运行后会提示 "系统找不到指定的文件", 不是是何原因.- echo.&echo.&echo.&echo.&echo.&echo.
- echo.&set /p T3= Please type in file format what you want:
- echo.&set /p T1= Please type in the characters that want to be replaced:
- echo.&set /p T2= Please type in the new characters:
- setlocal enabledelayedexpansion
-
- for /f "tokens=*" %%i in ('dir /a /b *.%T3%') do (
- set "var=%%i"
- if not !var!.==. (
- rem
- for /f "tokens=*" %%j in (!var!) do (
- set "tmp=%%j"
- if not !tmp!.==. (
- set "tmp=!tmp:%T1%=%T2%!"
- rem
- echo !tmp!>>temp.txt
- )
- )
- rem
- move temp.txt !var!
- )
- )
-
- echo.&echo.&echo.&echo.&echo Good, it is finished.
- pause
复制代码
|