[Windows Mobile Software Development] howdykeith:
ActiveSync

ActiveSync - repllog.exe

Found this in another forum:

Here are the ones I've found so far

/remote which appears just to start the Activesync application and

brings it to the foreground

/remote /all which starts the Activesync application, brings it to the

foreground and starts synchronising

/remote /all /h which starts the Activesync application and starts

synchronising without bringing it to the foreground

There seems to be a 'p' switch, which I'm guessing is something to do with

'ports' but I'm not sure what settings can be used with this

ActiveSync over Bluetooth - Press menu>>disconnect for ASync to close and exit

mortscript milksync

AppRunAfterTimeChange

Originally Posted by le_cactus View Post

Hi,

I couldn't live without it. The following script connects Bluetooth through ActiveSync and Syncs. The connection will remain active until the script is started again, or the connection is closed manually.

If NOT wndExists "Connected to MEDIACENTER"
RegReadDWord HKLM, System\State\Hardware, Bluetooth, Bluetooth
If Expression %Bluetooth% <= 8
Set BluetoothWas, "Off"
Run "\Windows\ToggleBTH.exe"
Sleep 3000
EndIf
Run "\Windows\rnaapp.exe", -n -m -e"MEDIACENTER"
WaitFor "Connected to MEDIACENTER", 15
Run "\Windows\udp2tcp.exe"
Run "\Windows\rapiclnt.exe", -dppp_peer
Run "\Windows\repllog.exe", /remote /sched /h
Sleep 1000
RegWriteDWord HKLM, System\State\Hardware, Cradled, 1
While wndExists "Connected to MEDIACENTER"
Sleep 1000
EndWhile
Run "\Program Files\MortScript\TKill.exe", UDP to TCP proxy
Run "\Program Files\MortScript\TKill.exe", Remote API Client
Run "\Program Files\MortScript\TKill.exe", ActiveSync
If equals %BluetoothWas%, "Off"
Run "\Windows\ToggleBTH.exe"
EndIf
Else
Run "\Program Files\MortScript\TKill.exe", Connected to MEDIACENTER
EndIf

This script did not work for me so I updated the syntax to the newer version of mortscript and changed some of the parameters. Here is the script:

as=RegRead("HKCU", "Software\SysVars","as") #Read my script status key (SysVars)
If (as=0)
Run("\Windows\rnaapp.exe", "-m -n -e""SPRENGPC0141""")

WaitFor("Connected to SPRENGPC0141", 15)

Run("\Windows\udp2tcp.exe")
Run("\Windows\rapiclnt.exe", "-dppp_peer")

Run ("\Windows\repllog.exe","/c:""SPRENGPC0141 """)

Sleep(1000)

RegWriteDWord("HKLM", "System\State\Hardware", "Cradled", 1)
RegWriteDWord("HKCU", "Software\SysVars", "as", 1)

Else

Run("\program files\vijay555\vjtaskkiller\vjtaskkiller.exe", "UDP to TCP proxy")
Run("\program files\vijay555\vjtaskkiller\vjtaskkiller.exe", "Remote API Client")
Run("\program files\vijay555\vjtaskkiller\vjtaskkiller.exe", "ActiveSync")
Run("\program files\vijay555\vjtaskkiller\vjtaskkiller.exe", "Connected to SPRENGPC0141")

RegWriteDWord("HKLM", "System\State\Hardware", "Cradled", 0)
RegWriteDWord("HKCU", "Software\SysVars", "as", 0)

EndIf

The major changes (apart from the newer Mortscript syntax) is the Repllog.exe command line parameter. The original did not work for me, mainly because the sync process never ends on the desktop ActiveSync window. Anyway I did some research into repllog.exe and here is a summary list of the UNDOCUMENTED command line parameters, in case anyone wants to play with them:

none => Opens activesync in background and tries to sync default connection. (tested but sync process never ends)

/remote => opens activesync window and brings it front. (tested OK)

/c:"BT CONNECTION NAME" => syncs to the specified bluetooth connection as listed in \\HKCU\Comm\RasBook. (tested OK)

/p:"BT PARTNERSHIP NAME" => syncs the specified partnership. (tested OK, but same result as /c:)

/d => disconnects (never tried)

/h => hides Activesync window (tested OK)

/sched => unknown, (tested, but didn't see a difference from none)

/all => unknown (tested, but didn't see a difference from none)

Thanks a million to le_cactus for the original script!

Control ActiveSync behaviour

I was tired of ActiveSync always being active on my Touch Diamond.

I tries the "Elias AsyncKiller" But still found it active almost all the time.

So I went for a more primitive and drastic solution!

ReplLog.exe is in ROM in the Windows dir. I Use the fact that copying a file over a file in ROM, hides the original. If you delete the copy, the original reappears. (And of course you can't delete the one in ROM)

(Please remember to change the Danish paths below to your local settings)

So I simply use this to disable ActiveSync

#This is done TWICE to avoid the case where the automatic launcher starts just after my Close, but before the dummy is copied.

For x=1 to 2
If (WndExists("ActiveSync"))
Close("ActiveSync")
EndIf
copy("\Internt lager\Programmer\DummyActiveSync\Dummy.exe", "\Windows\RePlLoG.exe",True)
Next
x=Choice( "ActiveSync Hidden", "ActiveSyng (ReplLog.exe) now hidden by dummy-exe", 1, 3, "OK" )

Where Dummy.exe is a do-nothing exe. ( an empty main() )

And this to reenable it.

Delete("\Windows\ReplLog.exe")
x=Choice( "ActiveSync Restored", "ActiveSync (ReplLog.exe) now restored (dummy deleted)", 1, 3, "OK" )

One great advantage is that you can charge the phone by the pc, without all the fuss of ActiveSync and Windows Mobile Device Center (WMDC). And connect it to any pc without thinking security.

PS. If you only use ActiveSync to transfer files. You could remove the automated run of WMDC in the run-registry key in the pc.

PPS There is no reason to start the real ReplLog.exe after the dummy is deleted, since the phone tries to start it within a few seconds.

Edit: NOTE the odd spelling used for "RePlLoG" , this is to make it even easier to recognize the dummy from the real one in a fileexplorer.

if there is an activesync connection, if so launch SPB Insight and autoupdate every 3 hours automatically