Start Programs on Plugin and Eject

Submitted by Isaac Waller on June 27, 2008 - 2:35pm

version 0.4 - see comments for downloads

I have created a program that lets you start programs on plug-in or eject of the drive. It starts all programs listed in the Autostart.ini file and then the PortableApps.com Menu. You place it in the root directory of your drive (F:/,G:/,etc) and set it instead of StartPortableApps.exe as the Autorun executable. This program would be useful if you have Miranda or Portable Skype and you want to start it as soon as you plug it in. It is very simple, but some people may find it useful until it is integrated into the PortableApps.com Menu.

It is reccommended just to use the wizard found at http://www.isaacwaller.com/usbstart/ to create Autostart.ini files, as it is much easier.

What to change in Autorun.inf:

[Autorun]
Open=StartPortableApps.exe
Action=Start PortableApps.com
Icon=StartPortableApps.exe
Label=Isaac USB

to:

[Autorun]
Open=USBStart.exe
Action=Start PortableApps.com
Icon=StartPortableApps.exe
Label=Isaac USB

Thank you,
Isaac Waller


( categories: )

Nice Work!

I and some others have made these types of apps, as they are probably the biggest thing that the menu is lacking currently. Taneth111 wrote MenuLauncher Portable, and I wrote UP ME and MultiLaunch. a plugin system in planning by Xopher (maggotb0y, author of geek.menu) where you can add plugins. See I am very bad at C++ (mainly because the structuring of the code bugs me) so I wrote mine in the same lang as the launchers, NSIS. Hopefully, autorunning multiple apps will be in the PAM 1.2/1.5/2.0 (whichever one it is).
And Welcome to PortableApps.com :D.

(BTW, you happen to know how to obtain the name of all executables within every subfolder of a given folder??? I'm trying to figure out the algorithm to write an app manager for the menu ;)).

Somebody give me a portable video editor... Please!
If ya wanna see my email, go to digitxpsemail.tk (at least for now!)
My dad saved over $850 a month, by switching to Geico! :P

(BTW, you happen to know how

(BTW, you happen to know how to obtain the name of all executables
within every subfolder of a given folder??? I'm trying to figure out the
algorithm to write an app manager for the menu ;)).

What language? The basic idea is to start a search in your top directory for all files and folders (*.*). If a found item is a folder (do an attribute check) then you recurse into that folder doing the same thing, search for all (*.*). If the item is a file, check for the EXE extension and add it to your list. It'll end up being a small looking loop, but you call the function from within itself (recurse).

Now, in most languages this is fine because you can declare variables in a local scope (when recursing you won't overwrite your previous variables where you will store the search handles). NSIS doesn't make this distinction I don't think, so you might have trouble if that's your language.

EDIT - you're going to have issues in NSIS. From the manual -

4.2.1.1 Var
[/GLOBAL] var_name
Declare a user variable. Allowed characters for variables names: [a-z][A-Z][0-9] and '_'. All defined variables are global, even if defined in a section or a function.

I suppose

AHK or Delphi or C++ (now that I got a book) or any C style language.

Somebody give me a portable video editor... Please!
If ya wanna see my email, go to digitxpsemail.tk (at least for now!)
My dad saved over $850 a month, by switching to Geico! :P

USBStart Editor

For a easier way to create Autostart.ini files:
http://www.isaacwaller.com/usbstart/

Off-Topic

is there any chance that I can see the PHP code for that page? I'm trying to learn PHP but the PHP book is in the Community College so I can't get it :(.

Somebody give me a portable video editor... Please!
If ya wanna see my email, go to digitxpsemail.tk (at least for now!)
My dad saved over $850 a month, by switching to Geico! :P

.3 link is dead

.3 link is dead

Equal opportunity means everyone will have a fair chance at being incompetent.
Lead, Follow, or get out of the way.

Are you sure

It works for me...
Don't right-click and save target as because it goes to a webpage first.

it works now, it was dead for

it works now, it was dead for about half an hour for me

Equal opportunity means everyone will have a fair chance at being incompetent.
Lead, Follow, or get out of the way.

version 0.4

  • Now you can close programs; #CLOSENotepad.exe will close Notepad.exe (do not put a starting directory!)
  • You can choose the executable for a menu:
    #MENUPStart\PStart.exe
    PStart
    Will start "PStart.exe" instead of the PortableApps menu. (you must put it before anything else, include a starting directory!)
  • Download:
    http://www.isaacwaller.com/download.php?id=7 - Executable
    http://www.isaacwaller.com/download.php?id=8 - Source

    Thank you, Isaac

Not AutoStarting?

Here is my autorun.inf:

[Autorun]
Open=v04.exe
Action=Start PortableApps.com
Icon=StartPortableApps.exe
Label=My Brain

When the drive connects it is detected and goodsync starts its automatic synchronization but USBstart does not run. If I manually start it, it starts the program in my autostart.ini just fine and also the portable apps menu as well.

Paul

Are you sure autoplay is

Are you sure autoplay is enabled on that computer?
Try on another computer; if it works, it is probably the autoplay.