Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Registry-based notification is based on two predefined events, AutoStartOnConnect and AutoStartOnDisconnect, each of which has its own registry key. When either event occurs, a command associated with the corresponding key is executed.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnDisconnect

To associate an application with an event
  1. Construct a value that uniquely identifies the application.

    The value should include a company and product name — MicrosoftActiveSync, for example.

  2. Enter the identifier value under one or both AutoStartOn registry keys.

  3. The data for the identifier should be the command line for the application to be executed, including arguments. The command line must be enclosed in quotation marks if arguments are used.

The following registry editor (.reg) file shows how to register a command line for both AutoStartOnConnect and AutoStartOnDisconnect. When the Windows Embedded CE-based device is connected, Notepad is started with a command-line argument of C:\Config.sys. When the Windows Embedded CE-based device is disconnected, Notepad is started with a command-line argument of C:\Autoexec.bat.

Copy Code
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
Services\AutoStartOnConnect]
	"MicrosoftActiveSync"="\"notepad"\ c:\\config.sys"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
Services\AutoStartOnDisconnect]
	"MicrosoftActiveSync"="\"notepad"\ c:\\autoexec.bat"

See Also