A USB peripheral device may automatically launch an application residing
in its memory after it is connected to a host or after restarting the
host if the USB flash drive has already been connected. Alternatively,
the USB peripheral device can automatically launch an application
residing on the host or on a network, which is accessible by the host.
The USB peripheral device has a USB interface and a controller, which is
operative to execute instructions for sending and receiving messages
through the USB interface. The controller is further operative, when
executing the instructions, to send to a host a stream of emulated
keystrokes, which emulated keystrokes cause the host to generate and
execute a startup script. Embodiments of the invention include a USB
peripheral device able to control a host and a method of using a USB
peripheral device to control a host.