Issue With Script To Reconnect Bluetooth Device (Bluetooth Command Line Tools)

I've set up the following script:

"C:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom" -b "38:b1:9e:e7:35:9d" -c -s111e
"C:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom" -b "38:b1:9e:e7:35:9d" -c -s110b
"C:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom" -n "Marathon" -c -s111e
"C:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom" -n "Marathon" -c -s110b

As suggested in this answer: How can I script a bluetooth device to connect/disconnect?

But for every line I'm getting the following error:

System Error. Code: 87.

The parameter is incorrect

Any idea why this could be?


I was having the same issue (from the same source)

I use this when switching my headphones off my phone onto my pain-cave zwift computer. At first it worked fine, now I get -87 and had to go back to switching in windows bluetooth control panel (which is a minor inconvenience!)

Seems that if I script it to do a -r followed by a -c for both services on the same address it works fine.

"c:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom.exe" -b "E4:22:A5:67:D0:49" -r -s110b
"c:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom.exe" -b "E4:22:A5:67:D0:49" -r -s111e
"c:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom.exe" -b "E4:22:A5:67:D0:49" -c -s110b
"c:\Program Files (x86)\Bluetooth Command Line Tools\bin\btcom.exe" -b "E4:22:A5:67:D0:49" -c -s111e