
我無法從電腦中刪除任何藍牙裝置。
我嘗試了很多方法。從裝置管理員、控制面板、設定、藍牙中刪除它。沒有工作。
為什麼這是一個問題?
假設我更換藍牙適配器。我無法添加該設備,因為該設備仍然存在。我也無法連接,因為它未與新適配器正確配對。
我嘗試取消隱藏設備將其刪除。再次顯示在裝置管理員中。
有些程式很久以前就做過一些解決方案。該程式不再存在。
這是許多 Windows 10 中發生的錯誤。
我該怎麼辦?
我只是想讓我的電腦“忘記”所有藍牙設備並啟動一個新的
所有這些藍牙設備都儲存在哪裡?我可以把它們全部刪除。
有人告訴我在 powershell 中貼上一些東西。就像基斯·米勒的回答一樣。
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.
我正在尋找更低的解決方案。諸如刪除某些註冊表項或某些目錄之類的事情。有關這些設備的所有資訊儲存在哪裡?我想刪除它們
答案1
建立一個還原點以防萬一。在裝置經理,嘗試將視圖切換到Devices by connection
並刪除USB Host Controller
:
讓事物檢測並重新啟動並查看情況如何。
將以下內容複製並貼上到電源外殼控制台視窗。按<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)