Hello all, I am having a query about the services in MS Windows
systems. I have a USB MP3 Player. Whenever I connect my MP3 player I
want it to auto sync with a folder in my computer.

Following is my understanding:
Whenever USB device is encountered at the port, OS finds location of
the driver to be loaded for the device at following location:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\ the device>

So when this service is loaded I want a simple executable to run on my
machine. When this service is unloaded, I want this executable to end.
(Or whenever the device is connected, I want application to be loaded,
when device is disconnected, I want it to be unloaded).

Is there any way to write such application?

Thanks in advance. Looking forward for your replies.