天天看點

win10 藍牙無法删除 完美解決方案win10 藍牙無法删除 完美解決方案

win10 藍牙無法删除 完美解決方案

問題描述

win10 藍牙裝置顯示已配對,但是無法連接配接,且無法删除,在裝置管理器界面解除安裝藍牙裝置和解除安裝驅動無效,重新開機後又全部回來了。

解決方案

下面提供兩種方法,可以都試一下,親測有效

方法一

  1. 下載下傳 修複工具,一路預設選項完成安裝。防止連結失效,附上 百度網盤連結
  2. 打開 Powershell,指令行輸入 btpair -u,回車執行
  3. 等待會,就可以去設定把藍牙裝置删除了

方法二

  1. 打開 Powershell,指令行輸入執行下面的代碼
$Source = @"
   [DllImport("BluetoothAPIs.dll", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
   [return: MarshalAs(UnmanagedType.U4)]
   static extern UInt32 BluetoothRemoveDevice(IntPtr pAddress);

   public static UInt32 Unpair(UInt64 BTAddress) {
      GCHandle pinnedAddr = GCHandle.Alloc(BTAddress, GCHandleType.Pinned);
      IntPtr pAddress     = pinnedAddr.AddrOfPinnedObject();

      UInt32 result       = BluetoothRemoveDevice(pAddress);
      pinnedAddr.Free();
      return result;
   }
"@

Function Get-BTDevice {
    Get-PnpDevice -class Bluetooth |
      ?{$_.HardwareID -match 'DEV_'} |
         select Status, Class, FriendlyName, HardwareID,
            # Extract device address from HardwareID
            @{N='Address';E={[uInt64]('0x{0}' -f $_.HardwareID[0].Substring(12))}}
}

################## Execution Begins Here ################

$BTR       = Add-Type -MemberDefinition $Source -Name "BTRemover"  -Namespace "BStuff" -PassThru
$BTDevices = @(Get-BTDevice) # Force array if null or single item
Do {
   If ($BTDevices.Count) {
      "`n******** Bluetooth Devices ********`n" | Write-Host
      For ($i=0; $i -lt $BTDevices.Count; $i++) {
         ('{0,5} - {1}' -f ($i+1), $BTDevices[$i].FriendlyName) | Write-Host
      }
      $selected = Read-Host "`nSelect a device to remove (0 to Exit)"
      If ([int]$selected -in 1..$BTDevices.Count) {
         'Removing device: {0}' -f $BTDevices[$Selected-1].FriendlyName | Write-Host
         $Result = $BTR::Unpair($BTDevices[$Selected-1].Address)
         If (!$Result) {"Device removed successfully." | Write-Host}
         Else {"Sorry, an error occured." | Write-Host}
      }
   }
   Else {
      "`n********* No devices foundd ********" | Write-Host
   }
} While (($BTDevices = @(Get-BTDevice)) -and [int]$selected)
           
  1. 執行完後,選擇你要删除的裝置,然後就可以去設定裡把藍牙裝置删除了

參考自:

How to completely remove a Bluetooth device from Win 10?

解決方法分别來自 9樓、22樓

繼續閱讀