Search code examples
windowsbatch-filewifirouter

Windows 7 Professional - How can I switch wifi routers by using a batch file?


I have two wifi routers, one for home and the other for work(vpn), and I need to switch them every day. If I just turn off the connection to one and connect to the other, there seems to be some kind of IP address conflict killing the connection. I fix it by issuing three commands:

  1. ipconfig /release
  2. ipconfig /flushdns
  3. ipconfig /renew

This is a tedious process, so I'd like to write a batch file that switches between the routers, and issues these commands. My question is, can I switch wifi routers by command prompt batch file?


Solution

  • It's funny how you guys delete accepted answers, when it was actually helpful.

    In any case, I was pointed to this site, and it gave what I needed: http://www.nextofwindows.com/how-to-manage-a-wireless-wifi-network-from-the-command-line-in-windows-7/

    netsh wlan connect name=networkname