It sometimes can be quite handy to start programs automatically when a new USB storage device is connected to the computer system. This can be an USB flash key or external hard drive. Applications that come to mind are automatic virus scans of the data on the drives or the start of True Crypt or another data encryption program if data on the USB storage device is encrypted.
USB Agent is a portable software program that provides this functionality. It requires some manual preparation before it will execute the programs. This should not take longer than a few minutes the most though. The most important step in the process is the creation of a new file on the USB device that has to be named usbagent.inf. The following information need to be added to the file after its creation (with a text editor):
[usbagent]
ON=start-app.exe
OFF=stop-app.exe
where start-app.exe and stop-app.exe need to be replaced with executables or batch files that the user wants to execute if the USB device is connected and disconnected. The executables and batch files can be stored on the USB device by using the format
ON=%basepath%\start-app.exe
where %basepath%\ is pointing to the root folder of the USB device.

USB Agent comes with an option to mount True Crypt containers that are stored on USB devices. This can be a handy option to automate the mounting of the encrypted container. The portable software is available at the developer’s German website. A link to Google Translate is listed at the top of the page to translate the page into a different language. The program itself is available in English and German and compatible with Windows 2000 and newer Microsoft operating system including Windows 7 and Windows Server 2008.