Windows 11'de Bluetooth kulaklığın kaldırılamaması

serhatt123

Hectopat
Katılım
1 Şubat 2020
Mesajlar
110
Kulaklığı kaldıramıyorum, böyle bir hata veriyor. Windows 11.
 

Dosya Ekleri

  • Ekran görüntüsü 2023-10-27 015008.png
    Ekran görüntüsü 2023-10-27 015008.png
    5,7 KB · Görüntüleme: 59
Son düzenleyen: Moderatör:
İlk önerim Bluetooth cihazınızın sürücüsünü silip yeniden yüklemenizdir. Eğer olmazsa:

Windows PowerShell'i yönetici olarak çalıştırın.

Kod:
$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)

Bu komut ile cihazlarınızı göreceksiniz ve cihaz kaldırmaya hazırsınız:

Kod:
******** Bluetooth Devices ********

    1 - Cihaz 1
    2 - Cihaz 2
    ...

Select a device to remove (0 to Exit):

Buradan istediğiniz cihazın numarasını yazarak silme işlemini gerçekleştirebilirsiniz.
 
İlk önerim Bluetooth cihazınızın sürücüsünü silip yeniden yüklemenizdir. Eğer olmazsa:

Windows PowerShell'i yönetici olarak çalıştırın.

Kod:
$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)

Bu komut ile cihazlarınızı göreceksiniz ve cihaz kaldırmaya hazırsınız:

Kod:
******** Bluetooth Devices ********

 1 - Cihaz 1
 2 - Cihaz 2
 ...

Select a device to remove (0 to Exit):

Buradan istediğiniz cihazın numarasını yazarak silme işlemini gerçekleştirebilirsiniz.

Dediğin kodla kaldırmayı başardım ama şimdi de kulaklığımı bulmuyor. Telefonda sorunsuz her şey hatta PC telefona Bluetooth ile de bağlanabiliyor.
 

Geri
Yukarı