• Force computer to connect wired, rather than wireless

    Home » Forums » Networking – routers, firewalls, network configuration » Force computer to connect wired, rather than wireless

    Author
    Topic
    #494925

    From what I can read elsewhere, this Windows 7 issue appears to be a hardy perennial.

    I have a dual channel (2.4 GHz & 5 GHz) router hard-wired to my fibre broadband. That is connected to my docking station, where I dock my laptop. Elsewhere in the house, I connect my laptop by WiFi.

    When docked, the laptop continues to connect by wireless, in preference to wired, and I do not seem to be able to do anything to force it to make a wired connection. Surely wired is preferred, both faster and more secure. If I disconnect the wireless connection, it soon remakes. Yes, I could disable the wireless on the router, so that wireless was not available in, or close to that room, but I don’t really want to do that.

    Other forums, and also Microsoft’s own forum, are unanimous in saying this is easy, all you do is to change the interface metric (Connection / Properties / TCP/IPv4 / Properties / Advanced) – uncheck Automatic metric, insert low value for the connection you want to favour, and a high value (up to 9999) for the one you want to choose as less preferred. This has NO (perceptible) EFFECT whatsoever! Poster on other forums (fora?) just say “Hum, ho, this is a known shortcoming of Win 7”, and mouth off about Microsoft.

    Does any Lounger have any alternative suggestions, that DO work?

    Dell E5570 Latitude, Intel Core i5 6440@2.60 GHz, 8.00 GB - Win 10 Pro

    Viewing 14 reply threads
    Author
    Replies
    • #1454518

      You could run a command to disable the wireless card when you dock.
      Try this thread: http://social.technet.microsoft.com/Forums/scriptcenter/en-US/06ceb3ff-0787-4df7-8992-53dc2b4a517b/get-dockingundocking-event?forum=ITCG

      cheers, Paul

    • #1454520

      Go into Device Management/Network Adapters – right click on the wireless adapter and select Disable.

      This way it will only connect wired and it will not auto wireless connect even after a reboot.

      You will obviously need to re-enable when you go roaming around the house.

    • #1454521

      This thread has a really nice mechanism, but you will need to tailor it to use the built-in Task Scheduler instead of the product under discussion.

      cheers, Paul

    • #1454522

      Paul – I thanked you for the multiple SSID question. That was the easy one, but this one is a bit more of a challenge to implement.

      Thank you for this, too; it will keep me quiet for quite a bit!

      Dell E5570 Latitude, Intel Core i5 6440@2.60 GHz, 8.00 GB - Win 10 Pro

    • #1454523

      All the laptops I’ve had (which isn’t many) have had a wireless button. Press that and wireless goes off on the laptop. Press again when needed. I assume that yours doesn’t have such a beast – which surprises me. My wife’s laptop does, and I use it when I create a Macrium image and the laptop is connected to the router by wire.

      I’m also surprised that there’s not a batch file solution, so you can have a shortcut on the desktop to turn off and on.

      Eliminate spare time: start programming PowerShell

    • #1454530

      Hi John, this will solve your problem. 36155-Wireless-Setting

    • #1454536

      John,

      Here’s a PowerShell utility I wrote that will allow you to toggle Ethernet/BlueTooth adapters on and off. I created a Scheduled Task to run on demand, used to force admin privileges w/o a prompt, which I then call from a Shortcut on my desktop.

      Code:
      
      
      [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
      [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") 
      
      Get-CimClass -PropertyName version -QualifierName dynamic | Out-Null
      Clear-Host
      $CurOS = Get-CimInstance Win32_OperatingSystem
      $VersionItems = $CurOS.Version.split('.')
      
      # Test to see if user is running Win 8.1 or later.
      
      If($VersionItems[0] -lt 6) {
        $Message = "You must have Windows 8.1 or later to run this program."
        [Windows.Forms.MessageBox]::Show($Message,"Program Terminated:", `
           [Windows.Forms.MessageBoxButtons]::OK , `
           [Windows.Forms.MessageBoxIcon]::Information)
        Exit
      }
      Else {
        If($VersionItems[0] -eq 6 -and $VersionItems[1] -lt 3) {
          $Message ="You must have Windows 8.1 or later to run this program."
          [Windows.Forms.MessageBox]::Show($Message,"Program Terminated:", `
             [Windows.Forms.MessageBoxButtons]::OK , `
             [Windows.Forms.MessageBoxIcon]::Information)
          Exit
        }
       }
      
      $colItems = Get-NetAdapter -Name *
      
      $fmt = @{Expression={ $_.Name};Label="Name";Width=35},
             @{Expression={$_.Status};Label="Status";Width=25}
      
      # Font styles are: Regular, Bold, Italic, Underline, Strikeout
      $Font = New-Object System.Drawing.Font("Tahoma",12,[System.Drawing.FontStyle]::Regular)
      $LBFont = New-Object System.Drawing.Font("Courier New",11,[System.Drawing.FontStyle]::Regular)
      
      $objForm = New-Object System.Windows.Forms.Form 
      $objForm.Text = "Network Card Selection:"
      $objForm.Size = New-Object System.Drawing.Size(650,320) 
      $objForm.StartPosition = "CenterScreen"
      
      $objForm.KeyPreview = $True
      $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") 
          {$SelectedNIC=$objListBox.SelectedItem;$objForm.hide()}})
      $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") 
          {$objForm.hide()}})
      $objForm.AcceptButton = $OKButton
      $objForm.CancelButton = $CancelButton
      
      $OKButton = New-Object System.Windows.Forms.Button
      $OKButton.Location = New-Object System.Drawing.Size(10,240)
      $OKButton.Size = New-Object System.Drawing.Size(85,27)
      $OKButton.Text = "OK"
      $OKButton.backcolor = "Green"
      $OKButton.Font = $Font
      $OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
      
      $CancelButton = New-Object System.Windows.Forms.Button
      $CancelButton.Location = New-Object System.Drawing.Size(105,240)
      $CancelButton.Size = New-Object System.Drawing.Size(85,27)
      $CancelButton.Text = "Cancel"
      $CancelButton.BackColor = "Red"
      $CancelButton.Font = $Font
      $CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
      
      $objLabel = New-Object System.Windows.Forms.Label
      $objLabel.Location = New-Object System.Drawing.Size(10,10) 
      $objLabel.Size = New-Object System.Drawing.Size(300,25) 
      $objLabel.Text = "Please select a Network Device:"
      $objLabel.Font = $font
      
      $objLabel2 = New-Object System.Windows.Forms.Label
      $objLabel2.Location = New-Object System.Drawing.Size(10,35) 
      $objLabel2.Size = New-Object System.Drawing.Size(150,25) 
      $objLabel2.Text = "Device"
      $objLabel2.Font = $font
      
      $objLabel3 = New-Object System.Windows.Forms.Label
      $objLabel3.Location = New-Object System.Drawing.Size(405,35) 
      $objLabel3.Size = New-Object System.Drawing.Size(150,25) 
      $objLabel3.Text = "Status"
      $objLabel3.Font = $font
      
      $objListBox = New-Object System.Windows.Forms.ListBox 
      $objListBox.Location = New-Object System.Drawing.Size(10,60) 
      $objListBox.Size = New-Object System.Drawing.Size(620,100) 
      $objListBox.Height = 175
      $objListBox.Font = $lbfont
      
      for( $curDrive = 0; $curdrive -lt $colitems.Count; $curDrive++)
      {
          $NICList = $colItems[$curDrive] | format-table $fmt -HideTableHeaders | out-string
          [void] $objListBox.Items.Add($NICList)
      }
      
      $objForm.Controls.AddRange(@($OKButton,$CancelButton,$objLabel,$objLabel2,$objLabel3,$objListBox))
      $objForm.Topmost = $True
      
      $dialogResult = $objForm.ShowDialog()
      
      if ($dialogResult -eq [System.Windows.Forms.DialogResult]::OK)
      {
          $SelectedNIC = $objlistbox.SelectedItem
          if ($SelectedNIC)   #Test for empty variable!!!!
          {
            $SelectedNIC = $objlistbox.SelectedIndex
          }
          Else
          {
            $SelectedNIC = "NONIC"
          }
      }
      Else
      {
        $SelectedNIC = "CANCELLED"
      }
      
      $objForm.dispose()
      
      if ($SelectedNIC -ne "CANCELLED" -and `
          $SelectedNIC -ne "NONIC") {
      
          if ( $colItems[$SelectedNIC].Status -eq 'Up' -or `
               $colItems[$SelectedNIC].Status -eq 'Disconnected' -or `
               $colItems[$SelectedNIC].Status -eq 'Not Connected') {
            $Message = $colItems[$SelectedNIC].name + " Disabled."
            disable-NetAdapter -Name $colItems[$SelectedNIC].name –Confirm:$false
          }
          Elseif ( $colItems[$SelectedNIC].Status -eq 'Disabled' -or `
                   $colItems[$SelectedNIC].Status -eq 'Not Present' ) {
                $Message =   $colItems[$SelectedNIC].name + " Enabled."
                enable-NetAdapter -Name $colItems[$SelectedNIC].name –Confirm:$false
          }
      }
      Else {
             $Message = "No action taken! `n`nNo NIC selected or user selected Cancel."
      }
      
      Clear-Host
      
       [Windows.Forms.MessageBox]::Show($Message,"Completion Status", `
           [Windows.Forms.MessageBoxButtons]::OK , `
           [Windows.Forms.MessageBoxIcon]::Information)
      
      Clear-Host
      
        [*]Copy the code above into Note Pad then save as Enable-Disable-Nics.ps1 (enclose whole name in quotes so it doesn’t get a .txt added to the end).
        [*]Create the Scheduled task called: NIC-Controller with the following parameters:
        Action Tab
        Program/Script: %windir%system32WindowsPowerShellv1.0PowerShell.exe
        Add arguments (optional): “d:PathEnable-Disable-NIC.ps1″
        Replacing d:Path with your location for the powershell script.
        [*]Create the shortcut with the following target: C:WindowsSystem32schtasks.exe /run /TN “NIC-Controller”

      Now all you need to do is double click the shortcut select the desired controller from the list and click OK the status will toggle (on/off).
      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1454540

      I can’t understand why this is being made more difficult than it is when it would take about 30secs to implement the suggestion that I’ve made and the same to undo.

    • #1454541

      But we like to have at least four options for when we’re bored!!!!

      cheers, Paul

    • #1454543

      Sudo,

      The right way, the wrong way, the Army way…and don’t forget MY WAY! 35623-ROTFLOL

      After all that’s why they call it a Personal Computer. :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1454546

      Actually, Roadrunners’s solution is the simplest. Make the setting change once and there’s no need toggle any settings or switches in the future.

      Jerry

      • #1454586

        Actually, Roadrunners’s solution is the simplest. Make the setting change once and there’s no need toggle any settings or switches in the future.

        Jerry

        It may well connect the LAN first but DHCP will still assign the wireless adapter with an IP address and it will pick up the broadcasted SSID, so you are still going to get a wireless connection.

    • #1454587

      Ya, I’ve had some interesting “crossover” with both enabled and wired connection preferred; some programs would use the wireless. I don’t know if this was because they were sent there if the wired was “busy” or they went on their own but regardless, some would grab it even though it was much slower and second in the preferred list.

    • #1454589

      Doesn’t happen on my Windows 8 laptop. The Wireless connection is not active when I plug in a wired connection. I haven’t used a Windows 7 wireless connection in awhile but I would be surprised if it happens in Windows 7. The How to Geek makes the same recommendation and doesn’t say anything about a wireless/wired conflict:
      http://www.howtogeek.com/117083/how-to-make-your-laptop-choose-a-wired-connection-instead-of-wireless/

      If I was the OP, I would try it and see how it works out before resorting to the other methods.

      Jerry

      • #1454597

        Doesn’t happen on my Windows 8 laptop. The Wireless connection is not active when I plug in a wired connection. I haven’t used a Windows 7 wireless connection in awhile but I would be surprised if it happens in Windows 7. The How to Geek makes the same recommendation and doesn’t say anything about a wireless/wired conflict:
        http://www.howtogeek.com/117083/how-to-make-your-laptop-choose-a-wired-connection-instead-of-wireless/

        If I was the OP, I would try it and see how it works out before resorting to the other methods.

        Jerry

        Windows 8 won’t even connect wirelessly, if there is a hardwired connection. That’s one of 8’s improvements over older versions.

        • #1454598

          I’ve just tried it on my Win 7 and I’ve still got 5 full bars in the system tray without any alerts – still reckon that disabling the wireless adapter in Device Management is the easiest way.

          Edit –

          Just as an after thought – when you wire up a Win 8 machine, can a wireless printer still see the computer ?

          • #1454614

            I’ve just tried it on my Win 7 and I’ve still got 5 full bars in the system tray without any alerts – still reckon that disabling the wireless adapter in Device Management is the easiest way.

            Edit –

            Just as an after thought – when you wire up a Win 8 machine, can a wireless printer still see the computer ?

            It depends — is your wireless printer connected wirelessly to the router, or wirelessly to the computer? If it is connected wirelessly to the router, then it makes no difference what you do with the computer’s wireless connection, as long as the computer is connected in some way (e.g. wired) to the router.

            Group "L" (Linux Mint)
            with Windows 10 running in a remote session on my file server
          • #1454618

            Just as an after thought – when you wire up a Win 8 machine, can a wireless printer still see the computer ?

            My wireless printer is available to my Windows 8 laptop without any issues. The laptop is connected through Ethernet and wireless is never active when that happens. It works just as Jim described.

        • #1454635

          Windows 8 won’t even connect wirelessly, if there is a hardwired connection. That’s one of 8’s improvements over older versions.

          Not only won’t it connect if Ethernet is present but if connected to Wi-Fi and then Ethernet is turned on the Wi-Fi automatically disconnects! HTH :cheers:

          May the Forces of good computing be with you!

          RG

          PowerShell & VBA Rule!
          Computer Specs

          • #1454639

            Not only won’t it connect if Ethernet is present but if connected to Wi-Fi and then Ethernet is turned on the Wi-Fi automatically disconnects! HTH :cheers:

            Indeed. That’s one thing Windows 8 does well (among many other things). Who could have imagined it? :).

      • #1455535

        Jerry:

        My Lenovo E430 (Win 7 Pro 64 bit) was already set as described in the howtogeek article. Still only accesses via the WiFi.

        Harry

        • #1455555

          Jerry:

          My Lenovo E430 (Win 7 Pro 64 bit) was already set as described in the howtogeek article. Still only accesses via the WiFi.

          Harry

          In Win 7, unless wireless is disconnected, disabled or switched off using the F keys, the router’s DHCP will still assign the Wireless adapter with an IP address and give you WiFi even when wired, but are you saying that with WiFi disabled that it won’t connect when wired ?

          • #1455594

            In Win 7, unless wireless is disconnected, disabled or switched off using the F keys, the router’s DHCP will still assign the Wireless adapter with an IP address and give you WiFi even when wired, but are you saying that with WiFi disabled that it won’t connect when wired ?

            Jerry:

            No, what I was saying was that following the geek article for changing priority and timing did not do it.

            This morning I searched and found my Lenovo .pdf Manual. F9 opens a screen which lets you turn wireless on or off. I turned it off, and now I get my ethernet connection.

            Harry

            • #1458270

              In Win7 you should only need to right-click the network icon on the taskbar in the lower right corner near the clock, click (left) “Open Network and Sharing Center”, click on “Connect or Disconnect”, click on your wireless connection and click “Disconnect”. Or GoTo Control Panel/Network and Sharing Center.

              Best to do the above *after* you have plugged in the ethernet cable.

              Should stay connected via cable until you disconnect the cable, when it should once again connect via the wireless connection (might take a minute or two).

              If the wireless connection doesn’t launch automatically you might have to go back into Network and Sharing Center and connect manually.

    • #1454590

      It would also help to know the type and model of laptop, plus the wifi software in use, to see if it had tools to limit the connection.

    • #1454656

      Thanks for the clarification.

      I’ve just checked mine with the laptop wired and wireless disconnected at the system tray and it printed okay as well.

      I never bother disabling the wireless on the odd occasion that I wire up and have never noticed any problems, but have seen the router system log get quite chatty continually confirming the LAN and Wireless connections.

      • #1454736

        Retired Geek – thank you for the comprehensive solution, which I may take a few days to contemplate. It’s fairly far into my confidence boundary and I assume that I can just delete the script if it has unintended consequences. I’ll post back if I use it.

        Roderunner – I found this and tried it before making my original post, and saw no effect at all.

        JWitalka – the How-to-Geek process looks like the same as Roderunner’s suggestion.

        Other posters – many thanks for your suggestions, including the pointers towards Occam’s razor.

        Dell E5570 Latitude, Intel Core i5 6440@2.60 GHz, 8.00 GB - Win 10 Pro

        • #1454737

          Roderunner – I found this and tried it before making my original post, and saw no effect at all.

          It works perfectly on my laptop, wireless when not connected, ethernet when connected by cable.

    Viewing 14 reply threads
    Reply To: Reply #1454546 in Force computer to connect wired, rather than wireless

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel