wmysbbs 当前离线
一级士官
@echo off set "push=aaa.ini" set/p NewName= 请输入游戏名: for /f "eol=[ delims== tokens=1,*" %%a in (%push%) do ( if "%%a"=="PlayerName" ( set GN=%%a set Name=%%b ) ) echo %GN%=%Name% echo %GN%="%NewName%" pause复制代码
Lumiere (Lucien)当前离线
上校
@echo off&setlocal enabledelayedexpansion for /f "delims=" %%a in (aaa.ini) do set str=%%a&echo !str:旧=新!>>aaaa.ini del aaa.ini&ren aaaa.ini aaa.ini pause>nul复制代码
TOP
tireless 当前离线
少校
@echo off set push="aaa.ini" set /p NewName= 请输入游戏名: set clear=. for /f "usebackq delims== tokens=1,*" %%a in (%push%) do ( if defined clear set clear=>%push% ( if "%%a"=="PlayerName" ( echo %%a="%NewName%" ) else ( if "%%b"=="" (echo;%%a) else echo %%a=%%b ) ) >> %push% )复制代码
原帖由 tireless 于 2009-7-27 18:54 发表 说详细一点。另,你是否对3楼代码进行了修改?