If I run the following command on my windows 7 system (where cable is the name of my network adapter)
netsh interface ip show ipaddresses cable
I get the following result:
Address 10.17.179.17 Parameters
---------------------------------------------------------
Interface Luid : Cable
Scope Id : 0.0
Valid Lifetime : 22h46m12s
Preferred Lifetime : 22h46m12s
DAD State : Deprecated
Address Type : Dhcp
Skip as Source : false
For this section of my batch file I only care about getting the IP address (in this example 10.17.179.17) into a variable for later use. The IP address changes everyday or so, so that is why I require a variable.
so effectively I want the result of:
@SET IPaddyVariableName=10.17.179.17
@SET IPaddyVariableName= <some batch file code I need help with as 10.17.179.17 is hardcoded>
Please help me get 10.17.179.17
(which obviously changes) into a variable? Once it's in a variable I'm sorted.
Thanks all!
netsh interface ip show ipaddresses cable