
批處理獲取外網IP寫入到指定位置請大家看看可有好辦法先謝過下面這段代碼是手動收入 ip地址替換掉conf.ini 中的 22.223.90.78能否自動的 讓外網地址寫入到22.223.90.78位置
nclick="copycode($('code0'));">復制代碼
- @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%

