I use multiple devices with my bluetooth earphone connected to my mac machine, phone, or tablet.
When I boot my windows machine, it automatically connects to and snatches my bluetooth earphone. This is very annoying.
Results from google on ways to disable this are unhelpful:
- Unpair the device (???)
- Disable bluetooth support system service via services.msc
- Disable the device via Device Manager
To fix this, I disable Microsoft Bluetooth Enumerator
device on shutdown, so on the following startup it will not attempt to automatically connect to the paired bluetooth devices.
To reenable it, I made a desktop shortcut runs a script to reenable the device, restoring Bluetooth to the normal state.
This was easier than I expected.
I found a one-liner command on reddit that finds the Microsoft Bluetooth Enumerator
entity and enables/disables it.
(GWMI Win32_PNPEntity -Filter "caption like '%bluetooth enumerator%'").Enable()
(GWMI Win32_PNPEntity -Filter "caption like '%bluetooth enumerator%'").Disable()
Once I have bluetooth disabled on startup, I want to be able to reenable it easily at any point after.
I created a shortcut that executes the command above, saved in a .ps1
file somewhere.
The script needs to be executed as administrator, and simply double clicking the .ps1
file does not do anything, so create a shortcut and modify it to run the script with powershell:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file "D:\enable-bt.ps1"
Then set it to be run as administrator in the advanced properties.
Apparently Windows has this neat thing called Task Scheduler
.
I initially tried to configure the disabler script to be run on startup, but it is not done early enough.
On boot, it snatches the bluetooth earphone and then the disabler runs.
Fortunately there is a super obscure event that triggers precisely right before shutdown, explained in stackexchange.
With this, on subsequent boot bluetooth is disabled and does not auto-connect.
To reenable it at any point after the startup, I can simply doubleclick the enabler script shortcut on my desktop.
It's not working