下面这段代码是手动收入 ip地址 替换掉 conf.ini 中的 22.223.90.78 能否自动的 让外网地址写入到 22.223.90.78 位置- @echo off
- color 4f
- setlocal enabledelayedexpansion
- set file=Conf.ini
- set "file=%file:"=%"
- for %%i in ("%file%") do set file=%%~fi
- echo.
- set replaced=22.223.90.78
- echo.
- set all=
- set /p all= 请输入你的服务器IP地址:
- for /f "delims=" %%i in ('type "%file%"') do (
- set str=%%i
- set "str=!str:%replaced%=%all%!"
- echo !str!>>"%file%"_tmp.txt
- )
- move "%file%"_tmp.txt "%file%"
复制代码
|