无法删除任何蓝牙设备

use*_*951 3 wireless-networking bluetooth windows-10

我无法从计算机中删除任何蓝牙设备。

\n

我尝试了很多方法。从设备管理器、控制面板、设置、蓝牙中删除它。没有工作。

\n

为什么这是一个问题?

\n

假设我更换蓝牙适配器。我无法添加该设备,因为该设备仍然存在。我也无法连接,因为它未与新适配器正确配对。

\n

我尝试取消隐藏设备将其删除。再次显示在设备管理器中。

\n

有些程序很久以前就做过一些解决方案。该程序不再存在。

\n

这是许多 Windows 10 中发生的错误。

\n

我应该怎么办?

\n

我只是想让我的电脑“忘记”所有蓝牙设备并启动一个新的

\n

所有这些蓝牙设备都存储在哪里?我可以把它们全部删除。

\n

有人告诉我在 powershell 中粘贴一些东西。就像基思·米勒的回答一样。

\n
This is the result. not only device I really want to remove is not listed, I cannot remove any devices at all\n\n    Select a device to remove (0 to Exit): 17\n    Removing device: Mi Phone mimax 3\n    Sorry, an error occured.\n    \n    ******** Bluetooth Devices ********\n    \n        1 - Generic Attribute Profile\n        2 - Bluetooth LE Generic Attribute Service\n        3 - Galaxy A70\n        4 - Device Information Service\n        5 - \xe5\xb0\x8f\xe7\xb1\xb3\xe8\x93\x9d\xe7\x89\x99\xe6\x89\x8b\xe6\x9f\x84\n        6 - Bluetooth LE Generic Attribute Service\n        7 - Generic Attribute Profile\n        8 - Bluetooth LE Generic Attribute Service\n        9 - Generic Access Profile\n       10 - Lenovo A6000\n       11 - Bluetooth LE Generic Attribute Service\n       12 - MX Master\n       13 - Generic Attribute Profile\n       14 - Device Information Service\n       15 - Device Information Service\n       16 - BT-163\n       17 - SMI-M1\n       18 - Bluetooth LE Generic Attribute Service\n       19 - Bluetooth LE Generic Attribute Service\n       20 - Avantree Saturn Pro\n       21 - Generic Access Profile\n       22 - Bluetooth LE Generic Attribute Service\n       23 - MX Master\n       24 - Generic Access Profile\n       25 - Bluetooth LE Generic Attribute Service\n    \n    Select a device to remove (0 to Exit): 24\n    Removing device: Generic Access Profile\n    Sorry, an error occured.\n    \n
Run Code Online (Sandbox Code Playgroud)\n

我正在寻找更低级别的解决方案。诸如删除某些注册表项或某些目录之类的事情。有关这些设备的所有信息存储在哪里?我想删除它们

\n

Kei*_*ler 5

创建一个还原点以防万一。在设备管理器中,尝试将视图切换到Devices by connection并删除USB Host Controller

在此输入图像描述

让事物检测并重新启动并查看情况如何。



将以下内容复制并粘贴到PowerShell控制台窗口中。按<Enter>执行:

$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 found ********" | Write-Host
   }
} While (($BTDevices = @(Get-BTDevice)) -and [int]$selected)
Run Code Online (Sandbox Code Playgroud)

  • 我确信某处有一句“谢谢”。不客气。 (2认同)