Hello,
Thanks to Autohotkey, I'm resuscitating an old Sony Vaio running Vista, and I would like to combine these two working scripts so I can toggle the disabling/enabling of my bluetooth.
Enable:
@echo off
set source=%~dp0
if "%source%x"=="x" set source=.\
"%source%devcon" Enable "USB\VID_044E&PID_3017&REV_0227" >NUL 2>&1
"%source%devcon" Enable "USB\VID_044E&PID_3017" >NUL 2>&1
Disable:
@echo off
set source=%~dp0
if "%source%x"=="x" set source=.\
"%source%devcon" Disable "USB\VID_044E&PID_3017&REV_0227" >NUL 2>&1
"%source%devcon" Disable "USB\VID_044E&PID_3017" >NUL 2>&1
Many thanks for any help/pointers,
Jake
Join 2 Working Scripts to Toggle
Re: Join 2 Working Scripts to Toggle
I have a primitive addition to my AHK:
#Persistent
#SingleInstance
!2::
toggle:=!toggle
if toggle
{
Run "C:\BTutilities\disable_BT.cmd"
}
else
{
Run "C:\BTutilities\enable_BT.cmd"
}
Return
This just alternates b/w the enabling/disabling scripts regardless of the actual state of bluetooth. Since the bluetooth icon in the systray appears when bluetooth is activated, that's the litmus test of whether or not bluetooth is available.
#Persistent
#SingleInstance
!2::
toggle:=!toggle
if toggle
{
Run "C:\BTutilities\disable_BT.cmd"
}
else
{
Run "C:\BTutilities\enable_BT.cmd"
}
Return
This just alternates b/w the enabling/disabling scripts regardless of the actual state of bluetooth. Since the bluetooth icon in the systray appears when bluetooth is activated, that's the litmus test of whether or not bluetooth is available.
Re: Join 2 Working Scripts to Toggle
Figured it out, or do you still have a question?
try it and see
...
...
Re: Join 2 Working Scripts to Toggle
Thank you for your follow-up.
I don't know if I should mark this post as solved since it's a toggle based merely on alternating scripts rather truly gauging if bluetooth is on, then disabling, or vice-versa.
Do you have an opinion about that?
I don't know if I should mark this post as solved since it's a toggle based merely on alternating scripts rather truly gauging if bluetooth is on, then disabling, or vice-versa.
Do you have an opinion about that?
Re: Join 2 Working Scripts to Toggle
Oh yes I see what you mean. Hmm no I wouldn't know how to check that.
try it and see
...
...