0

I cannot remove any bluetooth devices from my computer.

I tried so many ways. Removing it from device manager, control panel, settings, bluetooth. None work.

Why this is a problem?

Say I change bluetooth adapter. I can't add the device because the device is still there. I can't connect either because it's not paired correctly with the new adapter.

I tried unhide devices remove them. Shows up again in device manager.

There are solutions that some programs do some long time ago. The program no longer exist.

This is a bug that happens in many windows 10.

What should I do?

I just want my computer to "forget" all bluetooth device and start a new

Where are all those Bluetooth device stored? I can delete them all.

Someone told me to paste something in powershell. Something like Keith Miller's answer.

This is the result. not only device I really want to remove is not listed, I cannot remove any devices at all

    Select a device to remove (0 to Exit): 17
    Removing device: Mi Phone mimax 3
    Sorry, an error occured.
    
    ******** Bluetooth Devices ********
    
        1 - Generic Attribute Profile
        2 - Bluetooth LE Generic Attribute Service
        3 - Galaxy A70
        4 - Device Information Service
        5 - 小米蓝牙手柄
        6 - Bluetooth LE Generic Attribute Service
        7 - Generic Attribute Profile
        8 - Bluetooth LE Generic Attribute Service
        9 - Generic Access Profile
       10 - Lenovo A6000
       11 - Bluetooth LE Generic Attribute Service
       12 - MX Master
       13 - Generic Attribute Profile
       14 - Device Information Service
       15 - Device Information Service
       16 - BT-163
       17 - SMI-M1
       18 - Bluetooth LE Generic Attribute Service
       19 - Bluetooth LE Generic Attribute Service
       20 - Avantree Saturn Pro
       21 - Generic Access Profile
       22 - Bluetooth LE Generic Attribute Service
       23 - MX Master
       24 - Generic Access Profile
       25 - Bluetooth LE Generic Attribute Service
    
    Select a device to remove (0 to Exit): 24
    Removing device: Generic Access Profile
    Sorry, an error occured.
    

I am looking for a more lower level solution. Things like getting rid some registry entry or some directory. Where do all info about these devices stored? I want to just delete them

  • Have you checked hidden devices option in device manager and removed devices also? – EliteX Jun 30 at 8:17
  • YES. I have. Hidden devices. I downloaded software to remove ghosted device too – user4951 Jun 30 at 9:18
  • They told you to paste something like Keith Millers answer, or that exact code? One script is not necessarily the same as another. – Mokubai Jul 2 at 12:21
  • What errors do you get when you try to remove them in Device Manager or the Bluetooth control panel? Without any details it is hard to know what is going wrong. – Mokubai Jul 2 at 12:38
  • In device manager they got removed but show up again. In bluetooth control panel I got this vague message "remove failed" – user4951 Jul 2 at 16:29
1

Create a restore point just in case. In Device Manager, try switching the view to Devices by connection and deleting the USB Host Controller:

enter image description here

Let things fedetect & then restart & see how things are.



Copy & paste the following into a PowerShell console window. Press <Enter> to execute:

$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)
| improve this answer | |
  • A good answer that doesn't work. It's one of the thing I tried. I updated the question to include your answer – user4951 Jul 1 at 15:20
  • Is your issue with devices that won't unpair or competing adapters? – Keith Miller Jul 1 at 16:14
  • I just want to remove all devices and start over again – user4951 Jul 2 at 11:54
  • Try the Device Manager deletion I've added to my answer. – Keith Miller Jul 2 at 20:10
  • It works. Of course, mouse and keyboard is gone too for a while. I was panic. But a hard reset on computer allows that to work. Hurray. – user4951 Jul 3 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.