Changing IP address of local windows machine using NETSH in JAVA- HELP
807589Nov 23 2007 — edited Jul 25 2008Hi ALL,
I have written one java program to change the IP address of local
machine using netsh command tool and runtime.exec method in java.
String[] command1 = { "netsh", "interface", "ip", "set", "address",
"name=", "Local Area Connection" ,"source=static", "addr=",str1,
"mask=", str2};
Process pp = run.exec(command1);
The program is working fine.
Here I need to set interface name namely "Local Area Connection" in command.
Actually I should not hard code this and I should get this from
getting active network interface name. I have written program for
that, but the name I am getting is like "Intel(R) PRO/1000 PL Network
Connection - Net Firewall Miniport Interface". I am not getting name
as "Local Area Connection".
So please help me to resolve this issue.