Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have bluetooth headphones which I use to both listen to music from my mobile phone and to listen to videos on my laptop. They cannot be connected to both devices at once (note here), so I have to disconnect from one device before connecting to the next device.

To do this on Windows 7, I have to open Devices and Printers, open my bluetooth headphones, and click on the Connect/Disconnect button. I'd love to be able to run a script that triggers that Connect/Disconnect button. That way I could have a shortcut on the desktop or add a keyboard shortcut.

I've streamlined it somewhat by creating a shortcut to the bluetooth heaphones window (in Devices and Printers, right click on your bluetooth device and choose Create Shortcut). But it would be good to streamline further.

share|improve this question
2  
Yes. My computer does not have Bluetooth capabilities, but you can use AutoHotkey to automate the process. See my answer here for ideas: superuser.com/questions/403620/… – iglvzx Apr 4 '12 at 0:37
    
Thanks, good idea. I 'll try it out when I have a spare minute. – David Cook Apr 16 '12 at 1:22
    
@DavidCook Let us know if you get it sorted out, I'd love to grab a copy of that script. – BigElittles Jun 30 at 16:45
    
Sorry @Big, I don't think I ever sorted it out. Glad you found a solution. – David Cook yesterday

I found an a similar question, here is the resolution. http://stackoverflow.com/questions/29724513/automatically-adding-a-bluetooth-device-in-windows-8

@ECHO OFF
if exist toggle.txt goto :2
btpair -u
C:\NIRCMD\NIRCMDC setdefaultsounddevice "CompSpeak" 1
C:\NIRCMD\NIRCMDC setdefaultsounddevice "CompSpeak" 2

echo toggle>>toggle.txt

exit
:2
btpair -n"[Samsung] AirTrack" -p0000
C:\NIRCMD\NIRCMDC setdefaultsounddevice "Headphones" 1
C:\NIRCMD\NIRCMDC setdefaultsounddevice "Headphones" 2

del toggle.txt /q

exit

OP said that he was getting a pop up message box, but he is also on windows 8 so that might be unique to his setup.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .