As it turns out, once all services in use by a device get disabled, device gets released and disconnected by Windows automatically. In my example case below for WH-1000XM3 these are voice and music, and most headphones will work the same way. This will of course depend on device in use.
You will need Bluetooth Command Line Tools.
Voice is actually the hands free service (HFP) and music is just an audio sink (A2DP). Service identifiers will be necessary and they can be discovered through the usage of btdiscovery
command from the package above, or via the list of Bluetooth services. HFP voice is 111e
, A2DP music is 110b
.
Per btcom
command line help:
Usage:
btcom {-c|-r} {-bBluetoothAddress | -nFriendlyName} [-s{sp|dun|GUID|UUID}]
-c Create association between COM port and a remote service (Enable non-COM service).
-r Remove association between COM port and a remote service (Disable non-COM service).
-s Remote service to use (Default is Serial Port Service)
-b Bluetooth address of remote device in (XX:XX:XX:XX:XX:XX) format.
-n Friendly name of remote device.
To disconnect the device, issue the following (only works when run as administrator in my case, using Windows 10 1809 (17763.437)):
"C:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom" -n "WH-1000XM3" -r -s111e
"C:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom" -n "WH-1000XM3" -r -s110b
To connect again, issue the same with -c
instead of -r
. This works for other devices, not just headphones, as long as all services/profiles connected to by Windows get disabled/enabled.
Note: using -n <friendly name>
is much slower than using -b <address>
due to performing Bluetooth discovery.
@DavidCook Let us know if you get it sorted out, I'd love to grab a copy of that script. – BigElittles – 2016-06-30T16:45:31.037
Sorry @Big, I don't think I ever sorted it out. Glad you found a solution. – David Cook – 2016-07-22T03:46:35.020
2
Yes. My computer does not have Bluetooth capabilities, but you can use AutoHotkey to automate the process. See my answer here for ideas: http://superuser.com/questions/403620/enable-disable-a-network-adapter-with-a-keyboard-shortcut/403834#403834
– iglvzx – 2012-04-04T00:37:25.523Thanks, good idea. I 'll try it out when I have a spare minute. – David Cook – 2012-04-16T01:22:22.503