Yesterday I have found that I can't use the wireless network at some spots in my house. I used another modem as a WiFi booster and I managed to cover these spots.
The problem is that when I go to these dead spots I need to use static IP and change my primary DNS servers, or I get limited connection. Also, I still want to use DHCP when I'm not in these spots.
I have written two Batch files and a Python script to define the wireless adapter settings. I would like someone to take a look and suggest how to improve it.
Batch Files (I'm using shortcuts because of the option to run them as administrator)
netsh interface ip set address "Wi-Fi" static 192.168.x.x 255.255.255.0 192.168.x.x netsh interface ip set dns "Wi-Fi" static 192.168.x.x primary # This is the second modem netsh interface ip add dns "Wi-Fi" ISP.dns.IP index=2
netsh interface ip set address "Wi-Fi" dhcp netsh interface ip set dnsservers "Wi-Fi" source=dhcp
import subprocess as sub def WiFi(): filepath1 = Path_To_DeadSpots.bat.ink filepath2 = Path_To_Regular.bat.ink loc = input("Please choose your location: 1-Rooms, 2-Rest \n") while(loc != "1" and loc != "2"): print("Wrong input, please choose again") loc = input("Please choose your location: 1-Rooms, 2-Rest \n") if loc == "1": p = sub.Popen(filepath1,shell=True,stdout=sub.PIPE) else: p = sub.Popen(filepath2,shell=True,stdout=sub.PIPE) WiFi()