After installing PNotes I realized the need for a launcher that runs besides PAM also other applications each time I insert the USB drive. The proposed method for this is to use a batch file on the drive which is launched by Autorun.inf. In this file you type the commands you want to be run after or before PAM is launched and of course you must think of running PAM itself. This worked fine just by replacing following line in autorun.inf:
and the file Autoexec.bat looks like this:
It has though a little esthetical drawback: a command window is appeared during the time autoexec.bat is being run. This can be avoided using a VB shell script or a command line launcher like NirCMD that runs the batch file in hidden mode. Different methods are provided here:
I used NirCMD and changed the line mentioned above to this:
Open=PortableApps\NIRCMD.EXE EXEC hide PortableApps\Autoexec.bat
both NirCMD.exe and Autoexec.bat are placed in PortableApps folder.
My Suggestion is to integrate one of these methods in PAM to launch a specific batch file (like autoexec.bat) whenever PAM starts. This file is better placed in PrtableApps folder rather than in root.