ghacks Technology News

Start Programs Automatically With USB Agent

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

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.

Enjoyed the article?: Then sign-up for our free newsletter or RSS feed to kick off your day with the latest technology news and tips, or share the article with your friends and contacts on Facebook or Twitter.

Related Articles:

Control which Programs start for Beginners
Get rid of a huge programs list in the start menu
Optimize Windows Startup Programs With Start-Q
Start programs at specific times with this handy app
Automatically order your Windows XP Start menu alphabetically



About the Author:Martin Brinkmann is a journalist from Germany who founded Ghacks Technology News Back in 2005. He is passionate about all things tech and knows the Internet and computers like the back of his hand. You can follow Martin on Facebook or Twitter.

Author: , Friday December 11, 2009 -
Tags:, , , , ,


Responses so far:

  1. ilev says:

    Microsoft sees autoplay as a security risk and disabled the feature in Windows 7 as well as updated XP and Vista do disable it.

  2. Cornflower says:

    I downloaded this the other day when they disabled autoruns at my office, and it works great as it runs known programs from known USBs.

    I have found two things that may result in a single suggestion:
    1. I have a Read-only stick that after logging onto its encryption opens the read-write portion. I cannot generate usbagent.inf on this stick.
    2. There is an insecurity in that someone can place a usbagent.inf file on the USB to run malware. The issue here is that the name of the file is constant.

    Suggestion (once I learn Germant o suggest it) that usbagent have an option to run usbagent.inf from the host computer, so that it can decide what file to call from the usb drive., anming it as one will.

  3. marc says:

    I downloaded this and am trying to get it to run a program when i insert the stick into my laptop, running 7. I cant work out the %basepath% syntax, can someone post an example of how it should be written to run example.exe in C:program files please?

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

Subscribe without commenting

© 2005-2012 Ghacks.net. All Rights Reserved. Privacy Policy - About Us