You are here

Command line arguments for launcher?

17 posts / 0 new
Last post
Bliepo
Offline
Last seen: 6 years 9 months ago
Joined: 2009-01-28 12:43
Command line arguments for launcher?

I would like to know if it is possible to use command line arguments for the launcher (for example FirefoxPortable.exe) of my portable apps. I would like to know this, because I want it the .ini file (for example FirefoxPortable.ini).

I know I could achieve this by just deleting the file. However, I sometimes do need the file, so I was thinking of creating two shortcuts. One that launches the launcher without command line arguments, and one that launches the launcher with command line arguments.

If anyone needs more information to help me, feel free to ask.

gluxon
gluxon's picture
Offline
Last seen: 3 years 7 months ago
Developer
Joined: 2008-06-21 19:26
The launcher is programmed to

The launcher is programmed to pass on parameters to it's program.

So any parameters you give to FirefoxPortable.exe will go to firefox.exe

ota
Offline
Last seen: 14 years 11 months ago
Joined: 2009-04-22 17:02
How do you add parameters to

How do you add parameters to exe's?

Thanks

Augi
Offline
Last seen: 10 years 1 month ago
Joined: 2009-04-04 14:15
BAT Scripts

I would write a BAT script that would call on the portable EXE launcher.

For example, FirefoxPortable(ProfileManager).bat:
@ECHO OFF
START FirefoxPortable.exe -ProfileManager
EXIT

-----
EDIT

There doesn't seem to be a profile manager in portable Firefox, however, if you replace -ProfileManager with a website address, it then opens the website in FFP.

Limits are for people with no imagination.

ota
Offline
Last seen: 14 years 11 months ago
Joined: 2009-04-22 17:02
Sorry for being a little dim

Sorry for being a little dim here, but I do not fully understand...

If I create a .bat file, how do I get that in the PortableApps menu?

As I understand, rightly or wrongly, the exe in the programs folder calls the exe located in the programs app folder, for example:

...\PortableApps\FirefoxPortable\FirefoxPortable.exe
calls
...PortableApps\FirefoxPortable\App\Firefox\firefox.exe (how firefoxportable.exe knows where to find firefox.exe I do not know!!)

If this is the case do I delete firefoxportable.exe and replace it with a .bat calling firefox.exe?

Thanks for your help.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 19 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
What

What specifically do you need on the commandline? We may have a better solution?

Sometimes, the impossible can become possible, if you're awesome!

ota
Offline
Last seen: 14 years 11 months ago
Joined: 2009-04-22 17:02
I used the firefox program as

I used the firefox program as an example but I am really concerned with keepass (command line options I am guessing could be used with a variety of programs!!)

What I want to do is pass the key file in the command line as described in the keepass help center:

KeePass.exe "C:\My Documents\MyDatabaseWithFile.kdb" -keyfile:F:\pwsafe.key

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 19 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Local

In that case, you can use the local version of KeePass or a Windows shortcut without issue (since it's local), there's no need for the portable version. Using a key file is useless with the portable version (since the key file and DB would both be with you, defeating the purpose).

Most of the situations where a commandline is handy don't really fit in as well with a portable scenario.

Sometimes, the impossible can become possible, if you're awesome!

ota
Offline
Last seen: 14 years 11 months ago
Joined: 2009-04-22 17:02
I sort of see where you are

I sort of see where you are coming from...

The reason I ask is because when you open keepass you have to browse and choose the keyfile - you invariably have to hunt the keyfile down through the directories even if the files are on a USB key or local to the hard drive.

If it were possible to have the keyfile already listed then it doesn't matter whether you are using a local exe with a local keyfile or a USB exe with a USB keyfile.

Using a local version is OK so long as you don't want to take it with you...

Hopefully I haven't misunderstood.

Thanks for your help.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 19 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
No Keyfile

Using a keyfile with your portable database is pointless since they'd be on the same drive... which entirely defeats the purpose which is to lock your database on a local PC and only have it be able to open when you have your drive (usually a USB flash drive) with the keyfile on it plugged in to the PC.

So, just turn the keyfile off for your portable database within KeePass portable since it isn't doing anything security-wise. When off, KeePass Portable can be set to automatically open your last used DB in options. So KeePass Portable launches, prompts for your password and you're looking at your DB. (Note that this doesn't normally work in KeePass portably as the drive letter changes... but our launcher takes care of it for you)

Sometimes, the impossible can become possible, if you're awesome!

nemops
Offline
Last seen: 11 months 4 weeks ago
Joined: 2021-10-01 03:54
CommandLineArguments in ini file

I know, it's an old thread, but it would be sad if this was the last word on this matter for people looking for that information.
In my something\PortableApps\KeePassProPortable\App\AppInfo\Launcher\KeePassProPortable.ini I have following:
CommandLineArguments='C:\Path\to\Passwords.kdbx -keyfile:C:\Path\to\keyfile.key'
I put it in as the last line in the [Launch] section.
It has, alas, to be added again after every update.

Pathologist
Offline
Last seen: 14 years 11 months ago
Joined: 2009-04-03 06:25
[Self Promotion]

The command line arguments are the native part of the [link removed] applications manager. Much more simple. Smile

[Self promotion of closed source alternative menus is not permitted - mod JTH]

Pathologist
Offline
Last seen: 14 years 11 months ago
Joined: 2009-04-03 06:25
Jealousy

John,
It looks like you are too jealous. You remove links and names with diligence, wich worth better application (e.g. programming)
You do not want users to know a better than yours "open" solution. You mislead users and readers.
I am just curious - what's a profit to a man that gained millions of readers and lost a talent of a programmer?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Not at all.

It is a perfectly reasonable rule to have. Suggestions of things which are open source are allowed, but closed source is just against the way things are here. It's an open platform.

Also please don't use such strong language against John - especially when it's unwarranted. It is not jealousy. In some cases it can even amount to as much as anarchy...

(Also don't let's start a flame war here...)

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

bpollen
Offline
Last seen: 4 years 7 months ago
Joined: 2006-12-02 16:22
command line arguments

Maybe I am obtuse, but all I have seen is "answers" that imply his examples for WHY he wants to pass parameters to a program are pointless or better done some other way. I see no "yes or no" answer to a "yes or no" question.

So, the question still stands:

CAN you pass command line parameters?

KevinM
Offline
Last seen: 6 hours 55 min ago
Joined: 2010-09-03 09:36
Redacted

Reply redacted.

depp.jones
Offline
Last seen: 1 day 9 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
Already answered...

The first answer is your desired "yes". Everything that follows just fits to the specific scenario and is a perfectly reasonable way to find the solution for the problem, that the thread opener did not explain enough.

So: Yes, if the launcher is PAL, a command line switch is passed through to the app, that the launcher calls (exactly what gluxon said 3 years ago...). Wink
Keepass uses an old custom launcher, but a look at the source reveals, that command line parameters are passed as well - not that it would do any good in the specific case.

Log in or register to post comments