Problem statement
Mostly home broadband has static IP address while the company network uses dynamic IP address. Use following scripts to change the adapter settings accordingly.
Script to set static IP Address
netsh interface ipv4 set address "Local Area connection" static [ipaddress] [subnet mask] [gateway] 1
netsh interface ipv4 add dnsservers "Local Area Connection" [dns ip 1]
netsh interface ipv4 add dnsservers "Local Area Connection" [dns ip 2] index=2
Script to revert to dynamic IP Address
netsh interface ipv4 set address name="Local Area Connection" source=dhcp
netsh interface ipv4 delete dnsservers "Local Area Connection" all
Mostly home broadband has static IP address while the company network uses dynamic IP address. Use following scripts to change the adapter settings accordingly.
Script to set static IP Address
netsh interface ipv4 set address "Local Area connection" static [ipaddress] [subnet mask] [gateway] 1
netsh interface ipv4 add dnsservers "Local Area Connection" [dns ip 1]
netsh interface ipv4 add dnsservers "Local Area Connection" [dns ip 2] index=2
Script to revert to dynamic IP Address
netsh interface ipv4 set address name="Local Area Connection" source=dhcp
netsh interface ipv4 delete dnsservers "Local Area Connection" all