Disableing local bluetooth dongle before VH doesn't seem to work anymore on Windows 11

Hello

Since my last W11 upgrade, my script that switch between local BT dongle and VirtualHere doesn't work anymore, because the bluetooth dongle is now seen as a "Critical Device" by Windows:

if ($start) {
  Disable-PnpDevice "USB\VID_0A12&PID_0001\6&28CF390B&0&6" -Confirm:$false
  Start-Service -Name vhclient
} else {
  Stop-Service -Name vhclient -Force
  Enable-PnpDevice "USB\VID_0A12&PID_0001\6&28CF390B&0&6" -Confirm:$false

I tried with .\pnputil.exe /disable-device "USB\VID_0A12&PID_0001\6&28CF390B&0&6" /force but it asks for a reboot...

if someone has a fix or an other way to handle this :)

Thank you

#2

Whenever Windows ask you to "Reboot" if you disable a usb device that means the device (Bluetooth) is in use by something and so windows cannot disable. 
What you can try is https://www.uwe-sieber.de/misc_tools_e.html RestartUSBPort after disabling it and it will force it to disconnect and be disabled.