Static ip on windows with command

  # Show Interface

netsh interface show interface
Copied!

  # Rename Interface

netsh interface set interface name="Local Area Connection" newname="network"
Copied!

  # Static IP

netsh interface ipv4 set address "network" static 192.168.255.10 255.255.255.0 192.168.255.1
Copied!

  # Static DNS

netsh interface ipv4 set dnsservers "network" static 192.168.255.2
Copied!

  # Add DNS

netsh interface ipv4 add dnsservers "network" 8.8.8.8
Copied!

  # Remove DNS

netsh interface ipv4 set dnsservers "network" dhcp
Copied!

  # Remove Static Ip

netsh interface ipv4 set address "network" dhcp
Copied!

  # Restart Network Adapter

netsh interface set interface name="network" admin=disabled
netsh interface set interface name="network" admin=enabled
Copied!