[Windows Mobile Apps and Games] jackljane:
GRPSOff.exe problem to turn of data in CComm

Hi chriscsh,

This is a good tools. I am using it on my Omnia. Everything is great except when connected to GPRS taping the panel does not turn it off as expected. It seems that GPRSOff.exe doesn't work with Omnia. I have look into other tools that can do the same thing to replace the GPRSOff.exe but no joy so far. I found a workaround but not the best. Data connection depends on Phone connection. If you turn off phone it will turn off data. Enable the phone again but the data will stay off. :) Like I said not the best but it works for me. Well until someone find a better way.

Copy and Paste script below into a text editor. Save the file as datastatus.mscr. Copy and replace the original file in \Program Files\CComm\datastatus.mscr. You all done.

DataState=RegRead("HKLM", "System\State\Connections\Cellular", "Count" )
Status=RegRead("HKLM","Software\Microsoft\CHome\CComm\CondensedPage","PluginLabel")
If (Status eq "")

If (DataState eq "0")
Vibrate (200)
Connect ("The Internet")
RegWriteString("HKLM", "Software\Microsoft\CHome\CComm\Page4","TEXT2", "Connecting")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","0")
Sleep(10000)
Call ("dataconnect")
Else
Vibrate (200)
############# Workaround GPRSOff.exe problem #############
#RunWait(SystemPath("ScriptPath")\"GPRSOff.exe")
Runwait(SystemPath("ScriptPath")\"radiooff.exe")
Runwait(SystemPath("ScriptPath")\"radiooff.exe")
##########################################################
RegWriteString("HKLM", "Software\Microsoft\CHome\CComm\Page4","TEXT2", "Disconnecting")
RegWriteString("HKLM","Software\Microsoft\CHome\CComm\CondensedPage","icon4","\Program Files\CComm\CComm-data_off.png")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","0")
Sleep(2000)
RegWriteString("HKLM","Software\Microsoft\CHome\CComm\Page4","TEXT2", "Turn on data connection")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","1")
EndIf
Else

If (DataState eq "0")
Vibrate (200)
Connect ("The Internet")
RegWriteString("HKLM", "Software\Microsoft\CHome\CComm\Page4","TEXT2", "Connecting")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","0")
Sleep(10000)
Call ("dataconnect2")
Else
Vibrate (200)
############# Workaround GPRSOff.exe problem #############
#RunWait(SystemPath("ScriptPath")\"GPRSOff.exe")
Runwait(SystemPath("ScriptPath")\"radiooff.exe")
Runwait(SystemPath("ScriptPath")\"radiooff.exe")
##########################################################
RegWriteString("HKLM", "Software\Microsoft\CHome\CComm\Page4","TEXT2", "Disconnecting")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","0")
Sleep(2000)
RegWriteString("HKLM","Software\Microsoft\CHome\CComm\Page4","TEXT2", "Turn on data connection")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","1")
EndIf
EndIf
Sub dataconnect
If (DataState ne "0")
RegWriteString("HKLM","Software\Microsoft\CHome\CComm\Page4","TEXT2", "Connected")
RegWriteString("HKLM","Software\Microsoft\CHome\CComm\CondensedPage","icon4","\Program Files\CComm\CComm-data.png")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","1")
Else
RegWriteString("HKLM", "Software\Microsoft\CHome\CComm\Page4","TEXT2", "Network: Unavailable")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","1")
Sleep(2000)
RegWriteString("HKLM", "Software\Microsoft\CHome\CComm\Page4","TEXT2", "Turn on data connection")
RegWriteString("HKLM","Software\Microsoft\CHome\CComm\CondensedPage","icon4","\Program Files\CComm\CComm-data_off.png")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","0")
Sleep(500)

RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","1")
EndIf
EndSub
Sub dataconnect2
If (DataState ne "0")
RegWriteString("HKLM","Software\Microsoft\CHome\CComm\Page4","TEXT2", "Connected")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","1")
Else
RegWriteString("HKLM", "Software\Microsoft\CHome\CComm\Page4","TEXT2", "Network: Unavailable")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","1")
Sleep(2000)
RegWriteString("HKLM", "Software\Microsoft\CHome\CComm\Page4","TEXT2", "Turn on data connection")
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","0")
Sleep(500)
RegWriteDword("HKLM","Software\Microsoft\CHome\CComm","Updated","1")
EndIf
EndSub
#Data = 0 Off
#Data = 1 On