Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Star Lounger
    Join Date
    Dec 2009
    Location
    Edinburgh, UK
    Posts
    84
    Thanks
    13
    Thanked 5 Times in 3 Posts

    Force computer to connect wired, rather than wireless

    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?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    3,837
    Thanks
    7
    Thanked 252 Times in 237 Posts
    You could run a command to disable the wireless card when you dock.
    Try this thread: http://social.technet.microsoft.com/...ent?forum=ITCG

    cheers, Paul

  3. #3
    Silver Lounger
    Join Date
    Aug 2012
    Location
    UK
    Posts
    2,239
    Thanks
    37
    Thanked 298 Times in 289 Posts
    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.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    3,837
    Thanks
    7
    Thanked 252 Times in 237 Posts
    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

  5. #5
    Star Lounger
    Join Date
    Dec 2009
    Location
    Edinburgh, UK
    Posts
    84
    Thanks
    13
    Thanked 5 Times in 3 Posts
    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!

  6. #6
    5 Star Lounger access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    620
    Thanks
    55
    Thanked 46 Times in 43 Posts
    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.

  7. #7
    Gold Lounger Roderunner's Avatar
    Join Date
    Dec 2009
    Location
    Scotland.
    Posts
    3,426
    Thanks
    16
    Thanked 212 Times in 180 Posts
    Hi John, this will solve your problem. Wireless Setting.pdf
    George's PC Specs. / Laptop. Desktop.

  8. The Following User Says Thank You to Roderunner For This Useful Post:

    jjfreedman (2014-06-08)

  9. #8
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,486
    Thanks
    211
    Thanked 850 Times in 782 Posts
    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:
    <# +-------------------------------------------+
       | Program Name: Enable-Disable-NICs.ps1     |
       | Programmed by: ComputerMentor             |
       |           AKA: RetiredGeek                |
       | Created      : 11/22/2013                 |
       | Last Update  : 05/26/2014                 |
       | Version No.  : 3.1                        |
       | Requirements.: Windows 8.1+               |
       +-------------------------------------------+
    #>
    
    [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
    1. 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).
    2. Create the Scheduled task called: NIC-Controller with the following parameters:
      Action Tab
      Program/Script: %windir%\system32\WindowsPowerShell\v1.0\PowerShel l.exe
      Add arguments (optional): "d:\Path\Enable-Disable-NIC.ps1"
      Replacing d:\Path with your location for the powershell script.
    3. Create the shortcut with the following target: C:\Windows\System32\schtasks.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
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  10. #9
    Silver Lounger
    Join Date
    Aug 2012
    Location
    UK
    Posts
    2,239
    Thanks
    37
    Thanked 298 Times in 289 Posts
    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.

  11. #10
    Platinum Lounger
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    3,837
    Thanks
    7
    Thanked 252 Times in 237 Posts
    But we like to have at least four options for when we're bored!!!!

    cheers, Paul

  12. #11
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,486
    Thanks
    211
    Thanked 850 Times in 782 Posts
    Sudo,

    The right way, the wrong way, the Army way...and don't forget MY WAY! ROTFLOL.gif

    After all that's why they call it a Personal Computer.
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  13. #12
    Super Moderator jwitalka's Avatar
    Join Date
    Dec 2009
    Location
    Minnesota
    Posts
    4,999
    Thanks
    71
    Thanked 574 Times in 520 Posts
    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

  14. #13
    Silver Lounger
    Join Date
    Aug 2012
    Location
    UK
    Posts
    2,239
    Thanks
    37
    Thanked 298 Times in 289 Posts
    Quote Originally Posted by jwitalka View Post
    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.

  15. #14
    Silver Lounger
    Join Date
    Oct 2012
    Posts
    2,147
    Thanks
    12
    Thanked 248 Times in 241 Posts
    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.

  16. #15
    Super Moderator jwitalka's Avatar
    Join Date
    Dec 2009
    Location
    Minnesota
    Posts
    4,999
    Thanks
    71
    Thanked 574 Times in 520 Posts
    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-...d-of-wireless/

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

    Jerry

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •