Created
December 28, 2016 15:38
-
-
Save gusg21/d5c81c70cc0935be006b21673fadcf7d to your computer and use it in GitHub Desktop.
A command line tool to detect and optionally open the IPV4 address of your router.
This file contains 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
:: File: routerip.bat | |
:: Author: gusg21 | |
:: | |
:: A command line tool to detect and optionally | |
:: open the ip address of your router. | |
@echo off | |
for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set IPv4=%%~a && set IPV6=%%~b | |
echo IPV4: [ %IPV4%] | |
choice /M "Open this page?" | |
if %ERRORLEVEL% EQU 1 ( | |
echo Opening %IPV4%... | |
start "" http://%IPV4%/ | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment