如何在没有FN +密钥的情况下打开/关闭无线连接

时间:2014-02-26 15:14:51

标签: networking

我在互联网上查了一下,什么都没发现,他们都说键盘是唯一的方法,但是我有一个东芝,我从不触摸键盘来启用WIFI,我使用东芝程序这样做它确实与FN + F8相同。

所以我无法找到答案的问题是:这些制造商程序如何能够以按FN的方式打开/关闭无线?,这只是一个程序,所以我想知道命令对此负责......

我不是在谈论禁用适配器或通过Win Mobility Center打开/关闭无线..

1 个答案:

答案 0 :(得分:2)

尝试以下方法:

  

  • 进入CMD提示符,输入   在:
    netsh界面显示   界面
    按[Enter],并记下   确切的接口名称中包含“无线”一词。

      它被命名为“无线网络   连接4 “。
  • 创建禁用   WiFi 图标

    右键单击桌面上的任何空白区域   并选择新建>捷径。输入:
    netsh接口设置接口“ 无线   网络连接4 禁用
    和   按[Enter],然后输入:
    禁用   WiFi
    并再次按[Enter]。

      (当然,您需要更换“无线网络连接4 ”部分   以上命令指向无线连接的确切名称。
  •   
  • 创建启用WiFi 图标

    右键单击   桌面上的任何空白处,然后选择新建>捷径。类型   in:
    netsh接口设置界面   “ 无线网络连接4 ”   启用
    并按[Enter],然后键入   在:
    启用   WiFi
    并再次按[Enter]。

      (再次,替换“无线网络   连接4 “以上命令的一部分为准确   无线连接的名称。)。

  • 或使用此vbs切换此vbs切换:

    '~ Toggle a SPECIFIED NIC on or off
    Option Explicit
    
    Const NETWORK_CONNECTIONS = &H31&
    
    Dim objShell, objFolder, objFolderItem, objEnable, objDisable
    Dim folder_Object, target_NIC
    Dim NIC, clsVerb
    Dim str_NIC_Name, strEnable, strDisable
    Dim bEnabled, bDisabled
    
    ' =========================================================
    ' ===== place the name of your network adapter below ======
    ' examples:
    ' str_NIC_Name = "Local Area Connection 2"
    ' str_NIC_Name = "Wireless Connection 1"
    ' =========================================================
    str_NIC_Name = "Wireless Network Connection 4"
    ' =========================================================
    
    strEnable = "En&able"
    strDisable = "Disa&ble"
    
    ' create objects and get items
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(NETWORK_CONNECTIONS)
    Set objFolderItem = objFolder.Self
    Set folder_Object = objFolderItem.GetFolder
    
    ' see if the namespace exists
    If folder_Object Is Nothing Then
        Wscript.Echo "Could not find Network Connections"
        WScript.Quit
    End If
    
    Set target_NIC = Nothing
    
    ' look at each NIC and match to the chosen name
    For Each NIC In folder_Object.Items
        If LCase(NIC.Name) = LCase(str_NIC_Name) Then
            ' proper NIC is found, get it
            Set target_NIC = NIC
        End If
    Next
    
    If target_NIC Is Nothing Then
        WScript.Echo "Unable to locate proper NIC"
        WScript.Quit
    End If
    
    bEnabled = True
    Set objEnable = Nothing
    Set objDisable = Nothing
    
    For Each clsVerb In target_NIC.Verbs
        '~ Wscript.Echo clsVerb
        If clsVerb.Name = strEnable Then
            Set objEnable = clsVerb
            bEnabled = False
        End If
        If clsVerb.Name = strDisable Then
            Set objDisable = clsVerb
        End If
    Next
    
    If bEnabled Then
        objDisable.DoIt
    Else
        objEnable.DoIt
    End If
    
    '~ Give the connection time to stop/start
    WScript.Sleep 1000
    WScript.Quit