本帖最后由 mqyphts 于 2015-6-9 23:02 编辑
- @echo off
- setlocal enabledelayedexpansion
- ::file path 代表game.exe 路径
- set fp="filepath"
- set /p choose="你的选择?:1,2,3"
- echo.>tmp
- ::source.txt 代表原文件,1.txt,2.txt,3.txt代表要修改的选项
- if %choose%==1 (set secondfile=1.txt)
- if %choose%==2 (set secondfile=2.txt)
- if %choose%==3 (set secondfile=3.txt)
-
- (for /f "delims=" %%a in (source.txt) do (
- set str1=%%a
- set /p str2=
- set t1=!str1:~1,5!
- set t2=!str2:~1,5!
- if !t1!==!t2! ( echo !str2!>>tmp ) else ( echo !str1! >>tmp )
- ))<%secondfile%
- move /y tmp source.txt
- call %fp%
- pause
复制代码
|