Windows 7 64-bit netsh
In Windows XP and in Windows 7 32-bit, I use the following command to create a file which contains the IP Address and Subnet Mask:
cmd.exe /C netsh interface ip show address \"Local Area Connection\" > Ethernet_config.txt
This command produces the following output file:
Configuration for interface "Local Area Connection"
DHCP enabled: No
IP Address: 160.215.165.0
SubnetMask: 255.255.0.0
InterfaceMetric: 0
But the same command issued on a Windows 7 64-bit machine yields the following, which has no IP Address or Subnet Mask information:
Configuration for interface "Local Area Connection"
DHCP enabled: No
InterfaceMetric: 0
How can I get Windows 7 netsh to output the IP Address and Subnet Mask using a single command?
Thanks
August 1st, 2011 2:49pm
Since you're not using DHCP make sure you have a static IP address assigned. The only time I get that result with my 64-bit box (which uses DHCP) is when I have the cable unplugged:
Configuration for interface "Local Area Connection" <-- note that the Ethernet cable isn't connected
DHCP enabled: Yes
InterfaceMetric: 10
Configuration for interface "Wireless Network Connection"
DHCP enabled: Yes
IP Address: 172.19.11.42
Subnet Prefix: 172.19.0.0/16 (mask 255.255.0.0)
Default Gateway: 172.19.11.12
Gateway Metric: 20
InterfaceMetric: 20
August 2nd, 2011 11:45am
Hi,
The command should be:
Netsh interface IPv4 show addresses “Local Area Connection” >c:\aaa.txt
C:\aaa.txt is the file you want to create.
Regards,
Leo
Huang
Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
August 2nd, 2011 11:36pm


