I'm trying to change a machine IP address via cmd.exe with this code:
netsh int ip set address name="Local Area Connection" source=static addr=???.???.???.??? mask=255.255.255.0
The problem that the IP doesn't change (checked by ipconfig
) but doesn't not changed on the DHCP. Thus when I restart the machine, the IP is returned to DHCP.
I need a way to change the IP permanently via command line.
Any ideas?
You can use the command below:
where
192.168.0.100
is the IP address255.255.255.0
192.168.0.1
You can also have the DNS configured automatically by DHCP using following command:
If you are looking for change it regularly here is a trick :)
type above in notepad and save as
ip.bat
.run the file as administrator