2007-09-07

Getting IP address of any network interface on your XP

Information about all interfaces:

netsh diag show ip

Now, we use the mask to select the requested interface (this example selects the active PPTP connection):

netsh diag show ip Miniport*

Than, we strip unnecessary characters and get the IP address:

for /f "skip=3 tokens=3" %%a in ('netsh diag show ip Miniport*') do set VPNIP=%%a

echo %VPNIP%

No comments: