Created
January 13, 2022 15:54
-
-
Save maciakl/5659266b20e9d6a199cbaeaa129ef7e2 to your computer and use it in GitHub Desktop.
Get your public/routable ip address from the windows command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| for /f "tokens=1* delims=: " %%A in ( | |
| 'nslookup myip.opendns.com. resolver1.opendns.com 2^>NUL^|find "Address:"' | |
| ) Do set ExtIP=%%B | |
| echo %ExtIP% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment