MSFN Forum: Shortcut to enable/disable bluetooth/gps - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Shortcut to enable/disable bluetooth/gps

#1 User is offline   ElAguila 

  • Member
  • PipPip
  • Group: Members
  • Posts: 109
  • Joined: 22-October 06

Posted 09 March 2013 - 10:40 PM

Does anybody know of a shortcut that can be created that would allow you to enable or disable the Bluetooth and/or the GPS? Or at least a shortcut to bring up the Wireles screen of the PC settings? There are a lot of clicks/touches involved and it would be nice if there was a shortcut to do this.


#2 User is offline   DosProbie 

  • Member
  • Group: Supreme Sponsor
  • Posts: 205
  • Joined: 16-October 12
  • OS:Windows 8 x64
  • Country: Country Flag

Posted 13 March 2013 - 06:14 AM

View PostElAguila, on 09 March 2013 - 10:40 PM, said:

Does anybody know of a shortcut that can be created that would allow you to enable or disable the Bluetooth and/or the GPS? Or at least a shortcut to bring up the Wireles screen of the PC settings? There are a lot of clicks/touches involved and it would be nice if there was a shortcut to do this.

I assume by "shortcut" you mean either a batch or .vbs file, anyway you will need to get your hardware id for the device that you want to enable or disable, so
from command line type in: devcon find *> list.txt and that will give you all your IDs then use my example batch or .vbs that I use to toggle my Wi-Fi and revise as needed..Good Luck!
@echo off&color a&mode con: cols=60 lines=4&&title[~ TOGGLE Wi-Fi On/Off ~]
:: DosProbie ö¿ö - 03.13.13
:: Toggle.Device.Voice.cmd
:: NOTE: CHANGE DEV_0083 TO YOUR SPECIFIC HARDWARE ID!
:: To Find ID Run: devcon find *> list.txt

::CK IF ADMIN..
Reg Query "HKU\S-1-5-19" >nul 2>&1 && (
goto startbatch
) || (
echo Right-click file and run as Administrator!
echo.
ping -n 3 yahoo.com>nul 2>&1
goto eof
)
:startbatch
:: DISABLE if Ping successful..
ping -n 1 yahoo.com>nul 2>&1 
if %errorlevel% EQU 1 goto enable 
devcon disable *DEV_0083>nul 2>&1
cls
echo * WI-FI DISABLED *
set msg=Installation Successful
call :speak "Your device is now disabled!"
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
exit

:enable 
:: ENABLE Device..
devcon enable *DEV_0083>nul 2>&1
cls
echo * WI-FI ENABLED *
set msg=Installation Successful
call :speak "Your device is now enabled!"
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
:eof
exit

' Toggle.Wi-fi.vbs 
' 1st Click toggles off, 2nd Click toggles back on 
' DosProbie_2013
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
Const TemporaryFolder = 2 

Set objshell = wscript.CreateObject("wscript.shell") 
Set fso = CreateObject("Scripting.FileSystemObject") 

tempfile = fso.GetTempName 
path = fso.GetSpecialFolder(TemporaryFolder) 
tempfile = path & "\" & tempfile 
objShell.run "cmd /c devcon status *DEV_0083 >" & tempfile , 0 ,true 
arResults = Split(fso.OpenTextFile(tempfile).ReadAll,vbcrlf) 
fso.DeleteFile tempfile 
fResults = join(arResults,vbcrlf) 
if(InStrRev(fResults, "No matching")) then 
  Wscript.Quit(0) 
elseif(InStrRev(fResults, "running")) then 
  objShell.run "devcon disable *DEV_0083", 0, true 
else 
  objShell.run "devcon enable *DEV_0083", 0, true 
  objShell.run "devcon enable *DEV_0083", 0, true 
end if 

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 










This post has been edited by DosProbie: 14 March 2013 - 03:58 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy