cmd check myip

REM 主選單
:MENU
cls

For /f "tokens=2 delims=: " %%A in (‘nslookup myip.opendns.com. resolver1.opendns.com 2^>NUL^|find "Address:"‘) Do (Set ExtIP=%%A)
@Echo.
Echo External IP is : %ExtIP%

REM 若有變動則寫入IP.log 檔中
if not "%ExtOldIP%" == "%ExtIP%" (
Echo Time:%time:~0,8% External IP is: %ExtIP% >> IP.log )

set ExtOldIP=%ExtIP%

REM 每隔多久重新偵測一次
timeout /t 5
goto menu

:END

本篇發表於 未分類。將永久鍊結加入書籤。

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>