Page updated 15 January 2008
Some programs can accept "Command Line Options", that control how it behaves as it is launched. These options, sometimes referred to as "switches" are added to the command that is associated with the program's icon on the Desktop or Start Menu. It is also possible to start a Program directly with a command line entered in the Run dialogue, accessed from the Start Menu. The switches are simply added at the end of the command.
nPOPuk responds to a number of switches that enable it to be started:
- And automatically check for incoming mail, closing any pre-existing nPOPuk session
- With a designated mailbox active
(By default, the first mailbox is always the active one on launch.)
- From any platform, accessing the same set of mailboxes
(Assumes that multiple platform-dependent versions of nPOPuk are installed on a single Flash Drive or similar portable device.)
- With data loaded from a private area of the disk
(Useful where a single user's data needs to be kept private and multiple users' separate.)
- With a complete, or partially complete, new mail ready to send.
- And automatically send a predefined message
You need to be careful when entering command line options as there is a strict syntax to follow.
If you have created a Desktop Shortcut or Start Menu option as described on the Installation page, you should then be able right-click on that item and, from the menu that appears, select "Properties" to reveal a dialogue similar to that on the right.
The line marked "Target:" contains the command line. By default, this will simply show the name of the program file and its location within the filing system, all enclosed in double quotes. This is sufficient to tell the computer which program is to be launched and where to find it.
Command lines can also be entered in the dialogue that appears when the "Run..." option is selected from the main Start Menu. If you don't want to clutter your Start Menu or Desktop with a range of rarely used, but difficult to remember commands, then this can be a useful approach, as the Run dialogue includes a history of previously used commands that can be selected from a drop down list.
To launch nPOPuk and have it check for mail and then quit add "/q" (without the quotes) to the command line.
1. For this option to function as described above, the Global Option Check mail on start must be set.
2. If there is an instance of nPOPuk already running, this option will close the existing nPOPuk session and neither instance will check for new mail.
"C:\Program Files\nPOPuk\nPOPuk.exe" /q
To launch nPOPuk with a specified mailbox active, rather than the default (first) mailbox, add " /a:mailbox" (without the quotes) to the command line, where "mailbox" is the name of the mailbox to be made active on launch. e.g. To launch nPOPuk and immediately select a mailbox called "Work", use the command line:
"C:\Program Files\nPOPuk\nPOPuk.exe" /a:Work
NOTES: 1. This assumes that nPOPuk is installed in the folder indicated in the dialogue above. 2. There must be a single space separating the option string from the main command. 3. If the mailbox name contains spaces, the name must be enclosed in quotation marks. e.g. /a:"Work Mail" 4. This switch must appear before any option commands that generate a Pre-Defined E-Mail.
By default, on launch, nPOPuk looks for a file in the program directory called "nPOPuk.ini". This contains details of the user's data (mailboxes, address book, etc). If it is not found nPOPuk assumes this is a new installation and behaves accordingly, requesting details of the first account to be created. This information is then written to a new nPOPuk.ini file created in the same folder as the program file itself.
However, adding " /y:filespec" (without the quotes) to the command line, where "filespec" specifies the location and name of the nPOPuk.ini file, will force nPOPuk to load the information found there instead.
This option can be used where the user's data in installed on a flash memory device together with several different copies of nPOPuk.exe, one for each of the platforms to which the device will be connected, so allowing totally portability between all the platforms available to the user. The option is especially useful for users that access mailboxes through SSL, as the supporting DLLs are all named the same so need to be stored in separate folders with their respective copy of nPOPuk.exe.
In the example below a flash memory device contains a number of folders at the same level in the hierarchy:
/Mail - Containing a number of BAT files or Shortcut Icons with which to launch nPOPuk.
/Platform1 - Containing platform specific nPOPuk.exe and required DLLs.
/Platform#... - Further platform specific folders containing the required EXE and DLL files.
/MailData - Containing nPOPuk.ini, Address.lst, SendBox.dat and all MailBoxXX.dat files
A typical command line associated with one of the shortcuts in the /Mail folder would then look like this:
NOTES: 1. The "..\" sequence means go up one level from the current folder. Using this "relative addressing" means that it won't matter what drive letter is assigned when the card is inserted in the device. 2. There must be a single space separating the option string from the main command. 3. This switch must appear before any option commands that generate a Pre-Defined E-Mail.
On a typical installation, users will have installed nPOPuk in a sub-folder of the "Program Files" folder called "nPOPuk". By default a user's data will be placed in that same folder. This is not best practice and many users will want to have move their data to an area of the disk that is not accessible by others. Two steps are required to implement this:
- Edit the nPOPuk.ini file's DataFileDir setting to point to a folder in the users own area, typically a sub-folder of the "My Documents" folder.
- Always launch nPOPuk using the /y: command line option. The option takes an argument that specifies the location and name of the nPOPuk.ini file to be used.
With a typical installation and a user's data moved to a sub-folder of his "My Documents" folder called "MailData", the command would be:
C:\Program Files\nPOPuk\nPOPuk.exe /y:<My Documents>\MailData\nPOPuk.ini
Where <My Documents> represents the path to the user's own "My Documents" folder, typically:
C:\Documents and Settings\User\My Documents
where "User" is the user's own log-on name.
It is possible, with command line options, to cause nPOPuk to launch with most, or even all, elements of an e-mail predefined, and ready to save. The instructions for this are given in the sub-sections below. NOTE: An additional command line option must be used to send a predefined message on launch.
However, where all that is required is a pre-defined address, for the message then that address can simply be added to the command line. Any text following a single space after the nPOPuk.exe file name, other than the switches to select mailbox or nPOPuk.ini location mentioned above or the other option commands referred to below, will be interpreted as an e-mail address. That text will be inserted in "To:" line of the Property dialogue that will appear on launch. If a mailbox switch precedes the address text it will additionally cause that mailbox to be selected in the Property dialogue.
However, this approach is not recommended, as the far more powerful technique, outlined, below is preferred.
The first command line option must be " mailto:" (with the leading space but without the quotes). This command will launch nPOPuk with the Mail Property dialogue open. e.g.:
"C:\Program Files\nPOPuk\nPOPuk.exe" mailto:
Optionally, further data may be entered. This must follow immediately (i.e. no spaces) and may be either one or more valid e-mail addresses. e.g.:
"C:\Program Files\nPOPuk\nPOPuk.exe" mailto:[email protected]
Where more than one address is entered they should be separated by a comma and space. e.g.:
"C:\Program Files\nPOPuk\nPOPuk.exe" mailto:[email protected], [email protected]
Alternatively, or additionally, the "?" separator, which allows further command line options to be added, may be entered. e.g.:
"C:\Program Files\nPOPuk\nPOPuk.exe" mailto:[email protected]Here there is no To: address, but a ReplyTo: has been set. The full range of additional options is described below.
As suggested above, nPOPuk can take a number of command line options. Each option must be delimited by a particular character or pair of characters, as shown in the following table:
|First||space||A single space|
|Second||?||Query Mark - No Spaces|
|Each Subsequent||&&||Double Ampersand - No Spaces|
- cc=, bcc=, replyto=
These three options all take e-mail addresses as parameters. These are added to the appropriate field in the Property dialogue. e.g.:
To: and Cc: addresses are entered in the Property dialogue:
<nPOPuk> mailto:[email protected][email protected]
NOTE: In the above and further examples <nPOPuk> is a shorthand for the full path and file name enclosed in quotes.
Only a Bcc: address is set:
<nPOPuk> mailto:[email protected]
As with the mailto: option, multiple addresses can be included and these should be separated with a comma and space
Spaces are allowed. The option is not case sensitive and will find accounts regardless of the case used in the Account Settings dialogue.
Here the Property dialogue will open with the named account preselected:
<nPOPuk> mailto:?mailbox=my account
NOTE: This will find an account entered as "My Account" or "my account" etc.
To set the Property dialogue to open with an address entered in the To: and the "nPOPuk Support" account selected:
<nPOPuk> mailto:[email protected]?mailbox=npop support
Spaces are allowed. The option is case sensitive, i.e. any capitalisation is retained in the Property dialogue.
Open the Property dialogue with a To: address and Subject line set:
<nPOPuk> mailto:[email protected]?subject=Bug Report
Define a full path and file name
Open the Property dialogue with the nPOPuk address book attached:
<nPOPuk> mailto:?attach=C:\Program Files\nPOPuk\address.lst
NOTES: 1. Your Address Book may be stored in a different location. 2. Spaces in folder and files names can be written both as %20 and a space.
Enter any text. There are limitations to the use of this option:
- Signatures, defined in the Account Settings Dialogue, do not appear in the message body when this option is used.
- The Windows command line is limited to 260 characters, so any entry will have to be brief. The maximum length will, obviously, be dependant on the length of the other options being used.
- No formatting is allowed, effectively limiting, the body entry to a single line.
The examples below are split over several lines but when entered on the command line should be entered as a single line. As before <nPOPuk> needs to be replaced by the full path and file name enclosed in quotes:
<nPOPuk> mailto:[email protected]?subject=Bug Report&&[email protected] &&attach=a:\image.gif&&mailbox=nPOPuk Mail
<nPOPuk> mailto:?subject=Bug Report&&[email protected] &&[email protected]&&mailbox=Personal Mail&&body=Here is my report:
To send a predefined message (constructed with the "mailto:" parameter) as nPOPuk is launched, add " /s" (without the quotes) to the command line, e.g. use the command line:
<nPOPuk> mailto:[email protected]?subject=Bug Report&&[email protected] &&attach=a:\image.gif&&mailbox=nPOPuk Mail /s