A USB drive is detected at the time it is inserted into the computer. You can address it in a batch file just like any other drive. Suppose it is detected as drive "F," and you want to run a program called "My Program" in the root folder:
F:\My Program.exe."