2014-04-03 15:18:54 +0000 2014-04-03 15:18:54 +0000
7
7
Advertisement

检测到HP EliteBook上的以太网连接时,请禁用无线。

Advertisement

我公司最近开始给员工发放HP Elitebook,取代了我们以前使用的联想ThinkPads。

我想找到一种方法,当它检测到已经建立了以太网连接时,就可以禁用无线。

在我的ThinkPad上,这很简单,进入访问连接,创建一个新的位置,然后选择 “当检测到LAN连接时禁用无线 "的框,但是在我的EliteBook上,在惠普的同等软件(惠普连接管理器)中,我没有看到这个选项。

我是不是遗漏了什么?

Advertisement
Advertisement

答案 (6)

10
10
10
2014-04-07 21:42:59 +0000

如果你所关心的是它使用正确的连接,理论上Windows应该更喜欢最低的公制值的连接。大多数情况下, 这将是你的有线连接. 然而,如果你的有线连接是100Mbits,而你的无线连接是54Mbits,它们将收到相同的公制值。

要强制有线连接到更高的优先级,你可以做以下步骤 来源,和 类似问题)(你没有说,但我假设你有Windows 7或8):

1.打开 “网络和共享中心"。最简单的方法是右击时钟旁边的 "网络 "图标。它看起来会像无线信号强度条,或者像一台电脑,旁边有一根电缆。 2. 点击左侧栏的 "更改适配器设置"。 3. 在菜单栏中,点击 "高级",再点击 "高级设置…"。如果没有看到菜单栏,按键盘上的ALT键即可显示。 4. 在可用网络适配器的列表中,单击您的有线适配器,并使用箭头将其移动到列表的顶部。


如果您实际上想关闭适配器本身以节省电池电量,您可以使用 ) 几个选项。

  • 你可以设置 "计划任务",当检测到有线连接时,打开和关闭无线。

  • IntelliAdmin有一篇博客文章,它描述了一个VBScript,可以完全满足你的需求。你可以从那篇文章底部的链接中下载它。下载 "netswitch.dat "并将其重命名为 "netswitch.vbs"。在你的开始菜单中添加一个快捷方式,指向

  • 有些人已经在非联想电脑上实现了ThinkVantage Access Connections的工作。我没有附上下载链接,因为这样使用它可能违反联想的EULA。如果你阅读了该许可证,并决定你认为你是合规的,那么你可以在我的来源中找到下载链接,上面。

7
7
7
2014-04-11 19:46:46 +0000

惠普EliteBook笔记本电脑有一个内置的功能,当插入以太网电缆时,可以禁用无线连接。这叫做 “LAN/WLAN切换",可以在BIOS/UEFI设置中进行切换。

你需要采取的具体步骤可能会根据你的EliteBook型号而有所不同,但在我的6930p上,以下的步骤是可行的。

1.开机时按F10键进入BIOS/UEFI设置。 2. 进入系统配置→内置设备选项 3. 找到 "LAN/WLAN 切换 "选项,并选择旁边的 "已启用 "单选按钮 4. 保存更改并退出BIOS/UEFI设置,重新启动

这样就可以了。如果你有不同的型号(尤其是不同年代的型号),请查阅该型号的用户手册。

请注意,如果您使用惠普的ProtectTools软件,并安装了BIOS配置插件,那么您应该也可以在Windows中切换此设置,但您仍然必须重新启动才能生效。

2
Advertisement
2
2
2015-03-06 10:00:08 +0000
Advertisement

备用PowerShell解决方案。https://gallery.technet.microsoft.com/scriptcenter/WLAN-Manager-f438a4d7

WLAN管理器作为预定任务运行,并将在验证LAN连接时自动禁用WLAN卡。一旦LAN连接丢失,WLAN卡将被重新启用。这确保了您将拥有最快的可用连接,并有助于防止网络桥接。

原代码由微软Technet的 “物质 "提供。压缩文件

################ 
# WLAN Manager # 
################ 
#Version: 2015-03-03.2 
#Author: johan.carlsson@innovatum.se 

<# 

.SYNOPSIS 
Disables the WLAN NIC when LAN NIC network connection is verified. 
Enables WLAN NIC when LAN NIC network connection is lost. 

.DESCRIPTION 
WLAN Manager runs as a scheduled task and will automatically disable your WLAN card when a LAN connection is verified. 
The WLAN card will be re-enabled once the LAN connection is lost. This ensures you'll always have the fastest available connection and stops network bridging. 

.EXAMPLE 
.\WLANManager.ps1 -Install:$true 
Installs WLAN Manager. 

.EXAMPLE 
.\WLANManager.ps1 -Remove:$true 
Removes WLAN Manager. 

.EXAMPLE 
.\WLANManager.ps1 
Verify Installaton > Install if missing > Run Interactively (first run only, hidden run via scheduled task run after that). 

.EXAMPLE 
.\WLANManager.ps1 -Interactive:$true 
Runs WLAN Manager in an interactive window. Will not install anything. This mode is only for testing and watching what happens via console output. 

.NOTES 
None. 

.LINK 
https://support.innovatum.se 

#> 

[CmdletBinding()] 
Param 
( 
    [Parameter(Mandatory=$False,Position=1,HelpMessage="Installs WLAN Manager.")] 
    [switch]$Install, 
    [Parameter(Mandatory=$False,Position=2,HelpMessage="Removes WLAN Manager.")] 
    [switch]$Remove, 
    [Parameter(Mandatory=$False,Position=3,HelpMessage="Runs WLAN Manager interactively, doesn't install anything.")] 
    [switch]$Interactive 
) 

######################################### 
# Custom Variables for Your Environment # 
######################################### 
#Destination Path to where you want to store files for local install of WLANManager 
$CustomDestinationPath = "$env:ProgramFiles\WLANManager" 

<# 
D O N O T C H A N G E A N Y T H I N G B E L O W T H I S L I N E 
#> 

################################# 
# Unload/Load PowerShell Module # 
################################# 

#Remove PowerShell Module 
If ((Get-Module PSModule-WLANManager) -ne $null) 
    { 
        Remove-Module PSModule-WLANManager -Verbose 
    } 

#Import PowerShell Module 
$strBasePath = Split-Path -Path $MyInvocation.InvocationName 
Import-Module "$strBasePath\PSModule-WLANManager.psm1" -Verbose 

############################# 
# Install or Update Install # 
############################# 

If ($Remove -eq $true) 
    { 
        Remove-WLANManager -FilePath $CustomDestinationPath 
        return 
    } 
ElseIf ((Test-Path -Path $strBasePath) -eq $True -and ($Interactive) -ne $true) 
    { 
        #Install 
        Install-WLANManager -SourcePath $strBasePath -DestinationPath $CustomDestinationPath 
        If ($Install -eq $true) 
            { 
                #≥Windows 8 
                If ($OSInfo.Caption -match "Windows 8") 
                    { 
                        Start-ScheduledTask -TaskName "WLAN Manager" 
                        Exit 
                    } 
                #<Windows 8 
                Else 
                    { 
                        Start-STask -TaskName "WLAN Manager" | Out-Null 
                        Exit 
                    } 
            } 
    } 

######## 
# Main # 
######## 

while ($true) 
{ 
    If ((Test-WiredConnection) -eq $true -and (Test-WirelessConnection) -eq $true) 
        { 
            Write-Host "Wired connection detected, disabling Wireless connection... " -NoNewline -ForegroundColor Yellow 
            #≥Windows 8 
            If ($OSInfo.Caption -match "Windows 8") 
                { 
                    Disable-NetAdapter -InterfaceDescription *Wireless* -Confirm:$false 
                } 
            #<Windows 8 
            Else 
                { 
                    Disable-WLANAdapter | Out-Null 
                } 
            Write-Host "Done" -ForegroundColor White -BackgroundColor Green 
        } 

    If ((Test-WiredConnection) -eq $false -and (Test-WirelessConnection) -eq $false) 
        { 
            Write-Host "Wired connection lost, enabling Wireless connection... " -NoNewline -ForegroundColor Yellow 
            #≥Windows 8 
            If ($OSInfo.Caption -match "Windows 8") 
                { 
                    Enable-NetAdapter -InterfaceDescription *Wireless* -Confirm:$false 
                } 
            #<Windows 8 
            Else 
                { 
                    Enable-WLANAdapter | Out-Null 
                } 
            #Wait for WLAN Adapter to initialize and obtain an IP-address 
            while ((Test-WiredConnection) -eq $false -and (Test-WirelessConnection) -eq $false) 
                { 
                    sleep -Seconds 1 
                } 
            Write-Host "Done" -ForegroundColor White -BackgroundColor Green 
        } 

    Else 
        { 
            Write-Host "Sleeping..." -ForegroundColor Yellow 
            sleep -Seconds 1 
        } 
}
```。
0
0
0
2017-09-07 14:44:03 +0000

如果你有以太网的驱动程序,即。然后在弹出的窗口中点击连接管理器 3.然后是选项 4.在选项上勾选/勾选复选框禁用无线无线电,而以太网适配器是可用的

结果:无论何时你连接你的以太网电缆,无线连接将被禁用,优先考虑以太网连接。

0
Advertisement
0
0
2016-10-11 12:27:52 +0000
Advertisement

开机时按F2键进入Bios。转到电源管理 选择无线无线电控制 启用 控制 WLAN 无线电和控制 WWAN 无线电

如果启用,该功能将感知系统与有线网络的连接,随后禁用所选的无线无线电(WLAN 和/或 WWAN)。从有线网络断开后,所选的无线无线电将被重新启用。

0
0
0
2014-08-06 17:46:10 +0000

在Moshe Katz答案的帮助下,我想出了一个自定义的解决方案(感谢Moshe Katz!),它在我的100台笔记本电脑上运行良好。

将以下文本保存为wifiswitch.bat文件在C:\windows\system32下。确保检查笔记本上的接口名称与脚本相匹配。

@echo off
            Title Wifi Lan Switcher

            set a=0

            :loop
            netsh interface show interface name="Local Area Connection" | find /i "disconnected" > NUL 2>&1
            IF ERRORLEVEL 1 (
                netsh interface show interface name="Wireless Network Connection" | find /i "disabled" > NUL 2>&1
                IF ERRORLEVEL 1 (
                    netsh interface set interface name="Wireless Network Connection" disable > NUL 2>&1
                    set error=%errorlevel%
                    ping -n 5 127.0.0.1 >nul
                )
            ) 
            netsh interface show interface name="Local Area Connection" | find /i "disconnected" > NUL 2>&1
            IF NOT ERRORLEVEL 1 (
                netsh interface show interface name="Wireless Network Connection" | find /i "enabled" > NUL 2>&1
                    IF ERRORLEVEL 1 (
                        netsh interface set interface name="Wireless Network Connection" enable > NUL 2>&1
                        set error=%errorlevel%
                        ping -n 5 127.0.0.1 >nul
                    )
            )

            set /a a+=1

            echo.
            echo %a%
            ping -n 3 127.0.0.1 >nul
            if %a% equ 5 goto :eof
            goto :loop

            :eof
            echo.
            echo.
            set a=
            exit /b %error%

现在,你需要在计划任务下创建一个任务。你可以把我的任务xml代码保存在.xml中,然后导入到笔记本电脑的任务调度器中。确保将触发器选项卡下的源改为属于你的特定型号

<?xml version="1.0" encoding="UTF-16"?>
            <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
              <RegistrationInfo>
                <Date>2014-07-07T09:36:51.4300545</Date>
                <Author>%username%</Author>
              </RegistrationInfo>
              <Triggers>
                <EventTrigger>
                  <Enabled>true</Enabled>
                  <Subscription><QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='e1cexpress']]]</Select></Query></QueryList></Subscription>
                </EventTrigger>
                <BootTrigger>
                  <Enabled>true</Enabled>
                  <Delay>PT1M</Delay>
                </BootTrigger>
                <RegistrationTrigger>
                  <Enabled>true</Enabled>
                </RegistrationTrigger>
              </Triggers>
              <Principals>
                <Principal id="Author">
                  <UserId>S-1-5-18</UserId>
                  <RunLevel>HighestAvailable</RunLevel>
                </Principal>
              </Principals>
              <Settings>
                <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
                <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
                <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
                <AllowHardTerminate>true</AllowHardTerminate>
                <StartWhenAvailable>true</StartWhenAvailable>
                <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
                <IdleSettings>
                  <StopOnIdleEnd>true</StopOnIdleEnd>
                  <RestartOnIdle>false</RestartOnIdle>
                </IdleSettings>
                <AllowStartOnDemand>true</AllowStartOnDemand>
                <Enabled>true</Enabled>
                <Hidden>false</Hidden>
                <RunOnlyIfIdle>false</RunOnlyIfIdle>
                <WakeToRun>false</WakeToRun>
                <ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
                <Priority>7</Priority>
                <RestartOnFailure>
                  <Interval>PT1M</Interval>
                  <Count>3</Count>
                </RestartOnFailure>
              </Settings>
              <Actions Context="Author">
                <Exec>
                  <Command>%windir%\System32\WifiSwitch.bat</Command>
                  <WorkingDirectory>%windir%\system32</WorkingDirectory>
                </Exec>
              </Actions>
            </Task>
Advertisement

相关问题

3
13
5
16
4
Advertisement
Advertisement