1.bat- @echo off & cd /d "%~dp0"
- REM url
- set "url=http://ip.42.pl/raw"
- REM download
- certutil -urlcache -split -f "%url%" "temp.data" | findstr "0x" || set /p data=<"temp.data"
- REM handle
- echo %data%
- del /f "temp.data" >nul 2>nul
- pause&exit
复制代码 2.bat- @echo off & cd /d "%~dp0"
- REM url
- set "url=https://api.ipify.org/?format=json"
- REM download
- certutil -urlcache -split -f "%url%" "temp.data" | findstr "0x" || set /p data=<"temp.data"
- REM handle
- set "data=%data:{"ip":"=%"
- set "data=%data:"}=%"
- echo %data%
- del /f "temp.data" >nul 2>nul
- pause&exit
复制代码
|