Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Shortcut to enable/disable bluetooth/gps


  • Please log in to reply
1 reply to this topic

#1
ElAguila

ElAguila

    Member

  • Member
  • PipPip
  • 109 posts
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.
ASUS Rampage Formula ROG X48, Core 2 Quad Q9650 @4.02GHZ, GSkill 4x2GB PC8500 5-5-5-15 1116GHz, Quadfire 2 4870 X2's, Raid 0 2x500GB Seagate on SATA 1/2, Raid 0 2x500GB Seagate SATA II on 3/4,
Sony DVD Burner, Corsair HX1000W.


How to remove advertisement from MSFN

#2
DosProbie

DosProbie

    Friend of MSFN

  • MSFN Sponsor
  • 732 posts
  • OS:Windows 8.1 x64
  • Country: Country Flag

Donator

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 

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








Edited by DosProbie, 14 March 2013 - 03:58 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN