[Mogul, XV6800 General] saenzjoseph:
I'm using a third party app., its just a toggler so it does not know the state of the BT. I also want to know the state so I can return it to the state that it was prior to running the script...Here is an example of the script that I use it for...

This script is for

Checking ->turning BT ON or leave on

1 Screen full brightness (ac/batt) and no timeouts

2 Vol Max

3. Rotate and stay in lansdcape (using landscaper)

4. Run Live Search or Google Maps Etc.

6. Return everything to prior state..(there is no way to return vol through registry that I have found)

SavedVolume = RegRead ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedVolume")
SavedRingerVolume = RegRead ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedRingerVolume")
BattSuspendTimeout = RegRead ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","BattSuspendTimeout")
ACSuspendTimeout = RegRead ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","ACSuspendTimeout")
BatteryTimeout = RegRead ("HKCU", "ControlPanel\Backlight", "BatteryTimeout")
ACTimeout = RegRead ("HKCU", "ControlPanel\Backlight", "ACTimeout")
Brightness = RegRead ("HKCU", "ControlPanel\Backlight", "Brightness")
ACBrightness = RegRead ("HKCU", "ControlPanel\Backlight", "ACBrightness")
ACTimeoutUnchecked = RegRead ("HKCU", "ControlPanel\Backlight", "ACTimeoutUnchecked")
BatteryTimeoutUnchecked = RegRead ("HKCU", "ControlPanel\Backlight", "BatteryTimeoutUnchecked")
B = RegRead ("HKLM", "\System\State\Hardware\" , "Bluetooth" )

If ( B = 8 )
setVolume 255
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","BattSuspendTimeout",0)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","ACSuspendTimeout",0)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeoutUnchecked", 60)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeoutUnchecked", 60)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", 0)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", 0)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedVolume", 4294967295)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedRingerVolume", 4294967295)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", 10)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", 10)
Run( "\Program Files\ToggleBTh.exe" )
Rotate(90)
Run( "\program files\Landscaper.exe" )
WaitForActive( "Landscaper", 05 )
SendDown ( "Landscaper" )
Runwait( "\Program Files\Live Search\LiveSearch.exe" )
Close( "Landscaper" )
Run( "\Program Files\ToggleBTh.exe" )
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedVolume", SavedVolume)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedRingerVolume", SavedRingerVolume)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","BattSuspendTimeout",BattSuspendTimeout)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","ACSuspendTimeout",ACSuspendTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", BatteryTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", ACTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", Brightness)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", ACBrightness)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeoutUnchecked", ACTimeoutUnchecked)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeoutUnchecked", BatteryTimeoutUnchecked)
Rotate(0)
setVolume 213

Else
If ( B = 9 )
setVolume 255
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","BattSuspendTimeout",0)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","ACSuspendTimeout",0)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeoutUnchecked", 60)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeoutUnchecked", 60)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", 0)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", 0)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedVolume", 4294967295)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedRingerVolume", 4294967295)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", 10)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", 10)
Rotate(90)
Run( "\program files\Landscaper.exe" )
WaitForActive( "Landscaper", 05 )
SendDown ( "Landscaper" )
Runwait( "\Program Files\Live Search\LiveSearch.exe" )
Close( "Landscaper" )
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedVolume", SavedVolume)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedRingerVolume", SavedRingerVolume)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","BattSuspendTimeout",BattSuspendTimeout)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","ACSuspendTimeout",ACSuspendTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", BatteryTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", ACTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", Brightness)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", ACBrightness)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeoutUnchecked", ACTimeoutUnchecked)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeoutUnchecked", BatteryTimeoutUnchecked)
Rotate(0)
setVolume 213

Else
If ( B = 25 )
setVolume 255
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","BattSuspendTimeout",0)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","ACSuspendTimeout",0)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeoutUnchecked", 60)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeoutUnchecked", 60)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", 0)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", 0)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedVolume", 4294967295)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedRingerVolume", 4294967295)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", 10)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", 10)
Rotate(90)
Run( "\program files\Landscaper.exe" )
WaitForActive( "Landscaper", 05 )
SendDown ( "Landscaper" )
Runwait( "\Program Files\Live Search\LiveSearch.exe" )
Close( "Landscaper" )
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedVolume", SavedVolume)
RegWriteDword ("HKCU", "ControlPanel\Volume\Notifications\ShellOverrides","SavedRingerVolume", SavedRingerVolume)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","BattSuspendTimeout",BattSuspendTimeout)
RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts","ACSuspendTimeout",ACSuspendTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeout", BatteryTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeout", ACTimeout)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", Brightness)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", ACBrightness)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACTimeoutUnchecked", ACTimeoutUnchecked)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "BatteryTimeoutUnchecked", BatteryTimeoutUnchecked)
Rotate(0)
setVolume 213