本帖最后由 happyxxdhaha 于 2019-2-23 17:24 编辑
- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /a-d /s /b c:\9999.vmx') do (
- set list=aaa=bbb;ccc=ddd;eee=fff;
- echo %%i
- call:loop "%%i"
- )
- pause&goto:eof
-
- :loop
- if not defined list del tmp.tmp&goto:eof
- for /f "tokens=1,* delims=;" %%i in ("%list%") do (set tmp=%%i&set list=%%j)
- for /f "tokens=1,2 delims==" %%i in ("%tmp%") do (set a=%%i&set b=%%j)
- (for /f "usebackq delims=" %%i in (%1) do (set str=%%i&echo !str:%a%=%b%!))>tmp.tmp&>nul fc tmp.tmp %1||>nul copy tmp.tmp %1
- goto:loop
复制代码
|