1

I have two Wifi networks, one fast, one slow. The fast one has a monthly data limit, the slow one does not. My desktop does backups every night, and these can add significantly to the data limit, so I'd like to automatically switch to the slow network say at 10pm every night, and switch back in the morning. Is this possible?

Update 1: this fails every night switching to the slower network, which is: SFR_F280, SFR_F280_2GEXT, or SFR_F280_5GEXT (for the extender). I try all 3 in the batch file:

netsh wlan connect ssid="SFR_F280_2GEXT" name="SFR_F280_2GEXT"
if not errorlevel 1 goto :EOF
netsh wlan connect ssid="SFR_F280_5GEXT" name="SFR_F280_5GEXT"
if not errorlevel 1 goto :EOF
netsh wlan connect ssid="SFR_F280" name="SFR_F280"
if not errorlevel 1 goto :EOF

giving:

Profiles on interface Wi-Fi:

Group policy profiles (read only)

<None>

User profiles

All User Profile     : SFR_F280
All User Profile     : PSV 3229_5G
All User Profile     : SFR_F280_2GEXT
All User Profile     : SFR_F280_5GEXT
All User Profile     : PSV 3229
All User Profile     : AndroidAPacf 2
All User Profile     : AndroidAPacf
All User Profile     : ATT5dSYKI2
All User Profile     : TP-Link_Extender
All User Profile     : ATTYK9a3A2

The network specified by profile "SFR_F280_2GEXT" is not available to connect. The network specified by profile "SFR_F280_2GEXT" is not available to connect. The network specified by profile "SFR_F280" is not available to connect.

I've no idea why it can't switch.

Update 2: It turns out the wifi networks aren't stored and that a rescan is necessary to reload them all. From this thread Force refresh (re-scan) wireless networks from command line the following works:

explorer.exe ms-availablenetworks:
sleep 10

This is the CMD equivalent to manually opening the network icon in the lower right of the toolbar. The sleep is required to give it time to complete the scan.

dacfer
  • 187

1 Answers1

1

Yes, you can use task scheduler to execute a command at a certain time to switch Wi-Fi network.

First you need to get a list of the available profiles:

netsh wlan show profile

To connect to one of the profiles you need to execute the following:

netsh wlan connect ssid=<your Wi-Fi SSID> name=<your profile name>

You’ll need two scheduled tasks, one that runs at 10pm and another that runs at (say) 8am but with the setting enabled to run as soon as possible if the task is missed.

Richard
  • 6,420