Get IPv4 and IPv6 using command line

This little batch file prints out either the machine’s IPv4 or IPv6 (based on the given argument – ‘4’ or ‘6’). It works on Windows 7 and 2008 (and probably later editions as well).

Update 25-Nov-2013: The IPv6 format was not correct in some cases. I’ve updated the script below with the fix

@echo off
 if "%1"=="" goto usage
 if %1==4 (
 set ip_address_string="IPv4 Address"
 for /f "usebackq tokens=2 delims=':'" %%f in (`ipconfig ^| findstr /c:"IPv4 Address"`) do echo %%f
 goto :eof
 ) else if %1==6 (
 for /f "usebackq tokens=5" %%i in (`netsh interface ipv6 show address ^| findstr /c:"Manual"`) do echo %%i
 goto :eof
 )
:usage
 echo Usage: %0 ip_type
 echo Where ip_type is either 4 or 6
Advertisements

Perforce Merge 2013 Impressions

I’ve attended the Perforce Merge 2013 conference in Tel Aviv.

I am not a Perforce user, and I only know the basic principles behind it, but still I was interested to hear about their concept of ALM and their approach to implementing it.

The keynote theme was ‘Continuous Everything’ (Perforce’s ┬átake on the ‘continuous delivery’ trend). Superb presentation by Simon West, talking about how their new products and new server features enable better versioning, better collaboration, and better control.

Continue reading