PDA

View Full Version : Activate Wlan when ActiveSync starts


dabauer82
17th October 2008, 10:30 AM
hi

I am looking for a script or tool that will activate the wlan-option when ActiveSynch is connected? To save power, this tool should also disconnect wlan when AS is stopped. Someone knows already some tools for that?

or is it possible to get n toggle-button option for wlan as softkey?

thanks

neomagik
17th October 2008, 02:31 PM
Use this wifi toggle and assign it to a soft key with SoftKey manager.

If you install mortscript a fairly simple script can be written to toggle wifi on and off with an activesync connection. I have written a similar one to toggle wifi on automatically when I open pocket internet explorer or the Network plugin and off when I close them.

dabauer82
17th October 2008, 04:13 PM
hello,

yes i am already using mortscript (to set the registry key showsim = 0). i tried to find the wlan-toggle-key in the registry to turn it on and of, but i didn't find it. and also i don't know how to get the activsync status...

thanks for your toggle-sricpt, i will use it for the first time...

neomagik
19th October 2008, 10:40 PM
Changing registry values to turn hardware on or off using mortscript does not work. That's why you need to get mortscript to run the toggle I attached.

Try this script

-----------------------------------------------------------------

VariableValue = 0
While (1)
#Detect for USB connection
SyncState = RegRead("HKLM", "System\State\Hardware", "Cradled")
If (SyncState = 1 && VariableValue = 0)
#Turn on Wifi
Run "Path to\Wifi_on-off.exe"
VariableValue = 1
EndIf

#Detect for USB disconnection
SyncState = RegRead("HKLM", "System\State\Hardware", "Cradled")
If (SyncState = 0 && VariableValue = 1)
#Turn off Wifi
Run "Path to\Wifi_on-off.exe"
VariableValue = 0
EndIf

Sleep 2000

Endwhile

-----------------------------------------------------------------

Remember to place the script or a link to the script in your Windows\Startup folder

dabauer82
27th October 2008, 02:12 PM
works perfect! thanks!

TyTiN
28th February 2009, 10:49 PM
Changing registry values to turn hardware on or off using mortscript does not work. That's why you need to get mortscript to run the toggle I attached.

Try this script

-----------------------------------------------------------------

VariableValue = 0
While (1)
#Detect for USB connection
SyncState = RegRead("HKLM", "System\State\Hardware", "Cradled")
If (SyncState = 1 && VariableValue = 0)
#Turn on Wifi
Run "Path to\Wifi_on-off.exe"
VariableValue = 1
EndIf

#Detect for USB disconnection
SyncState = RegRead("HKLM", "System\State\Hardware", "Cradled")
If (SyncState = 0 && VariableValue = 1)
#Turn off Wifi
Run "Path to\Wifi_on-off.exe"
VariableValue = 0
EndIf

Sleep 2000

Endwhile

-----------------------------------------------------------------

Remember to place the script or a link to the script in your Windows\Startup folder


Hi neomagik,

Can you perhaps provide me with that script you have written please?,i don't know how to write scripts ... :)