
- 帖子
- 33
- 积分
- 48
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2021-1-25
|
我也来一个,看20年还有人回复,加上了外网的查询跟归属地,看看有没有大神再帮小弟精简下
@echo off
title 内外网IP查看工具-By NT
@echo.
mode con cols=38 lines=15
color F0
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a")
@echo 请将以下内容截图或
@echo 本工具生成在桌面的
call :ColorText Fc " IP信息"
@echo 发送给网管
@echo ════════════════════════════════════
for /f "delims=: tokens=2" %%i in ('ipconfig^|findstr "IPv4 地址"') do echo 内网IP为:%%i &echo 内网IP为:%%i >>IP信息.txt
for /f "delims=: tokens=2" %%m in ('ipconfig -all^|findstr "物理地址"') do echo 网卡地址:%%m &echo 网卡地址:%%m >>IP信息.txt
for /f "delims=: tokens=2" %%o in ('curl -s cip.cc^|findstr "IP"') do set ip=%%o&echo 外网IP为:%%o >>IP信息.txt
for /f "delims=: tokens=2" %%l in ('curl -s ipinfo.io^|findstr ""region""') do set ad=%%l&echo 所在地区:%%l >>IP信息.txt
@echo 外网IP为:%ip%
@echo 所在地为:%ad%
@echo ════════════════════════════════════
set /p=" 按任意键退出并删除"<nul
call :ColorText Fc "IP信息"
@echo 文档
pause>nul
for /r %%f in (IP信息.txt) do del %%f
goto :eof
:ColorText
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1
goto :eof |
|