If you find your Windows device is choosing a Wi-Fi network you don’t want to use, you can use the Command Prompt to block it to stop it being displayed as an option.
Type netsh wlan add filter permission=block ssid= networktype=infrastructure to block one network at a time.
To block multiple Wi-Fi networks, type netsh wlan add filter permission=denyall networktype=infrastructure followed by exemptions for the networks you do want to use.
To remove a blocked network, type netsh wlan delete filter permission=block ssid= networktype=infrastructure.
To delete all blocked networks, type netsh wlan delete filter permission=denyall networktype=infrastructure.
You can also stop networks from being saved in your history by going to Settings > Network & internet > Wi-Fi > Manage known networks, and choosing the Forget option.
To allow these networks again, you may need to restart your device, or perform a network reset.
You can also use ipconfig /flushdns to reset your network settings.