Click here to Skip to main content
12,944,972 members (49,709 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


3 bookmarked
Posted 26 Feb 2010

PC ActiveSync Can Be Used to Automate Tasks on Device Connection

, 26 Feb 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
PC ActiveSync can be used to automate tasks on device connection

You can have several apps started every time a device connects via ActiveSync on your PC. To enable this, you have to enter the application(s) to start in your PC Windows registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect]
"OnConnect"="\"c:\\windows\\system32\\cmd.exe\" /c d:\\OnConnect\\install.bat"

In this example, the batch file d:\OnConnect\install.bat will be launched every time a device connects via ActiveSync. If you use the itsutils, you can specify a list of commands executed against the connected device. In example, you can use the following install.bat (assuming that all tools and files are in d:\OnConnect) to always install certain files onto the device.

@echo on
cd d:\OnConnect
pput -f -v 
	"\DiskOnChip\Persistent Copy\CabFiles\"
pput -f -v 
	"\DiskOnChip\Persistent Copy\CabFiles\"
pput -f -v "\DiskOnChip\Persistent Copy\CabFiles\"
pput -f -v "\DiskOnChip\Persistent Copy\CabFiles\"
pregutl @region.reg
pause "ReBoot ?"
pause "*************** Finished **************************"

These lines copy some files to the device, change the registry with a regedit4 conform file (download sample), sync the time of the device to your PC time and then perform a warmboot. Using the XDA tools (itsutils), there are many more possibilities. This is especially useful, as PocketPC devices do not support batch files on the device.

<!-- Social Bookmarks BEGIN --> <!-- Social Bookmarks END -->


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Germany Germany
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170518.1 | Last Updated 26 Feb 2010
Article Copyright 2010 by hjgode
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid