0

I am fortunate enough to have two wired internet connection and co-incidentally my PC's motherboard also has two Ethernet ports (Gigabit and Intel)

Both internet connections are wired ADSL and connect to my PC using a router and Lan cables.

The manual method of switching is answered here

However , I want to do it frequently because as one connection has higher speed while the other one has better and stable ping and access to some servers the first one doesn't have.

Are there any applications out there which can make one of the two connections as active with flick of a switch while completely disregarding the other one, like I don't want to have data being sent partially over both connections.

2

You could have two powershell scripts each of which enables one interface and disables the other, there is a very good article here that describes how to do this.

You can test this out by opening a PowerShell as Administrator they using Get-NetAdapter to get a list of your current network interfaces.

You can then enable them and disable them individually with:

  • Disable: Get-NetAdapter wildcard that matches that one interface | Disable-NetAdapter -Confirm:$false
  • Ensable: Get-NetAdapter wildcard that matches that one interface | Enable-NetAdapter -Confirm:$false

Example

Using VMWare as my test targets

enter image description here

Once you have your commands tested you can copy them to a couple of .ps1 files and set up shortcuts to them on your desktop, (don't forget to set them to run as Administrator), and you have direct commands to switch to either network.

This should work on Windows versions Windows 8 and above.

You could also write a PowerShell script to toggle between the two networks with something like: Get-NetAdapter Ether* | ? status -ne disabled | Disable-NetAdapter and Get-NetAdapter Ether* | ? status -eq disabled | Disable-NetAdapter

This has the advantage of not costing anything as it uses the built in PowerShell.

Creating Shortcut

From OPs Experience

a straight shortcut to PS1 file had run as admin greyed out so you have to instead make a shortcut to powershell.exe with the ps1 file as argument. Then I found out that executing script was disabled so I had to add bypass option in the shortcut target. In the end I had to use the following in shortcut target:

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -File "D:\Tools\NetTool\BSNL.PS1"

Looks complex but works like a charm

| improve this answer | |
  • Interesting , Mr.Barnes , I'll give this a go asap – user1062760 Sep 6 '16 at 3:52
  • Thanks It worked , took a lot of fiddling to get a shortcut to ps1 script work with admin rights on win 10 – user1062760 Sep 7 '16 at 8:52
  • @user1062760 - It should have been just create a shortcut, (copy then paste as shortcut), and right click on the shortcut -> Compatibility -> Tick Run this program as an administrator. Glad it worked for you anyway. – Steve Barnes Sep 7 '16 at 16:15
  • a straight shortcut to PS1 file had run as admin greyed out so you have to instead make a shortcut to powershell.exe with the ps1 file as argument. Then I found out that executing script was disabled so I had to add bypass option in the shortcut target. In the end I had to use the following in shortcut target %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -File "D:\Tools\NetTool\BSNL.PS1" Looks complex but works like a charm – user1062760 Sep 8 '16 at 5:15
  • @user1062760 - Glad you found out how to get it going. – Steve Barnes Sep 8 '16 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.