I've been looking into this because Windows 8 loves to autoconnect to my s305 headset, even though I often want to connect it to my phone, and Windows//my particular set-up is very greedy, refusing to release connection.
My solution is a hotkey that disables the bluetooth service, which I use before turning on the headset. (see my old method for auto connecting in the comment, I just made a link to the headset connection command)
^!+b:: EnvGet, DROPBOX, DROPBOX Run
;Run explorer.exe "C:\Users\s9b\Dropbox\Install and Setup\Win7Files\s305.lnk"
^!+n:: EnvGet, DROPBOX, DROPBOX Run
(disabling a service with dependencies requires admin access, so I use an admin-access-enabled .lnk to a .bat file)
bat files just say:
net stop bthserv
net start bthserv
net start bthHFSrv
But back to your question. It seems someone over in the autohotkey forums found a way to change the registry value for the default audio device.
; Toggle Sound Devices !+s::
RegRead, Device, HKEY_CURRENT_USER, Software\Microsoft\Multimedia\Sound Mapper, Playback
if(Device = "Realtek HD Audio output")
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Microsoft\Multimedia\Sound Mapper, Playback, Sound Blaster
Device := "Audigy"
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Microsoft\Multimedia\Sound Mapper, Playback, Realtek HD Audio
Device := "Realtek"
ToolTip, % "Sound Device: " Device
SetTimer, ResetToolTip, 1000 return