Command Line Parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
/CHECK and /CHECKALL /SEND and /SENDALL /IMPORT /EXPORT /FOCUS mailto: /ADD /OP /DEDUPIGNOREMSGID, /DEDUPIGNORETOMSGID, /DEDUPIGNORETO and /DEDUPIGNOREDATE /BATCH /LDIFIMPORT and /LDIFEXPORT /REFILTER /MINIMIZE, /MIN, /EXIT, /SMARTEXIT, /NOLOGO and others What is a Command LineThe command line is a text string that is passed to the system whenever a program is executed. It contains the path to the program, followed by a set of parameters. To start a program in Windows, you can either use the Start menu "Run" command, or click on the program’s shortcut on the desktop or in the Start menu. If you start a program by clicking its shortcut, you can edit the command line in the properties of this shortcut. Right-click the shortcut, select “Properties” and under “Shortcut” change the command line in the “Target” field. For The Bat!, the command line in a Shortcut looks like this: "C:\Program Files (x86)\The Bat!\thebat32.exe" or "C:\Program Files\The Bat!\thebat64.exe" You can add some start-up parameters to the command line to define a set of actions performed whenever you start the program. For example, you can switch off the The Bat! start-up logo by adding the /NOLOGO parameter: "C:\Program Files (x86)\The Bat!\thebat32.exe" /NOLOGO ![]() Using The Bat! command line parameters from batch files and other programsIt is possible to use The Bat! from batch files or other programs meaning that you are able to automatically send and receive emails. For example, to send two email messages, run the following sequence of commands from a batch file, provided that the current directory is "C:\Program Files\The Bat!\thebat64.exe": thebat64.exe /MAILTO=[email protected];SUBJECT=Test;TEXT=c:\test\test1.txt thebat64.exe /MAILTO=[email protected];SUBJECT=Test;TEXT=c:\test\test2.txt This example demonstrates using the /MAIL command line parameter for automated message creation. Following is the description of all command line parameters that The Bat! supports. Checking Mail - /CHECK and /CHECKALL/CHECK can be used as a command line parameter whenever you want to check mail for one or more accounts. /CHECKALL is used for checking mail for all accounts and exiting from The Bat! if there were no new messages received. It is a simplified form of the /CHECK* /SMARTEXIT combination. Syntax /CHECK<account mask1>[;account mask2[;account mask3[...]]] The account mask is used to identify which accounts to perform the check operation for. It can be: Note: To separate account masks, use semicolons (";" character). Do not use spaces between account masks, because a space-separated mask will be interpreted as the start of the next command line parameter and will not be processed as intended. If a mask contains space characters, enclose it in quotation marks. If a mask contains quotation marks, you should use single quotes (" ' " character).
Sending Mail - /SEND and /SENDALLThe /SEND command can be used as a command line parameter for The Bat!, whenever you want to send all queued mail from one or more accounts. The /SENDALL command is used for sending queued mail from all accounts and exiting from The Bat!, if there were no queued messages. It is a simplified form of the /SEND* /SMARTEXIT combination. Syntax /SEND<account mask1>[;account mask2[;account mask3[...]]] The account mask is used to identify the accounts to perform the send operation for. It can be:
Importing Messages - /IMPORTThe /IMPORT command allows to import messages to a specified folder from RFC-822 message files or from UNIX mailbox files. Syntax /IMPORT[parameter1[;parameter2[;parameter3[...]]] Possible Parameters
Examples /IMPORTU="Account 1";FOLDER="Friends\Sam";IN=C:\Inbox\Sam\*.MSG /IMPORTF="\\Account 1\Business\Unsorted";UNIX;FILE=C:\Inbox\Unsorted\*.mbox;READ Exporting Messages and Addresses - /EXPORTThe /EXPORT command allows to export messages from a specified folder to RFC-822 message files or UNIX mailbox files. This command also allows the export of address book entries if the LDIF parameter is specified. Syntax /EXPORT[parameter1[;parameter2[;parameter3[...]]] Possible parameters
Examples /EXPORTU="Account 1";F="Friends\Sam";DIR=C:\Inbox\Sam\;S=-20 /EXPORTF="\\Account 1\\Unsorted";UNIX;O=C:\Unsorted\Mail.mbx;UNREAD /EXPORTLDIF;AB="Address book 1";Group="My group";O="C:\MyGroupFile.LDIF" /EXPORTLDIF;Group="Friends";O="C:\Friends.LDIF" Focusing on a Folder - /FOCUSThe /FOCUS command allows you to automatically focus on a specified folder in the main window. Syntax /FOCUS[parameter1[;parameter2[;parameter3[...]]] Possible Parameters - (a parameter may be identified by two or more names):
Examples /FOCUSU="Account 1";F="Friends\Sam" /FocusF="\\My account\New mail";P=mypass Automated Message Creation - /MAILThe /MAIL command is used for automated message creation using a template, text file and attachments for a specified address. Syntax /MAIL[parameter1[;parameter2[;parameter3[...]]]
Examples /MAILU=MyAccount;TO=[email protected];S=Test;TEXT=C:\TEST\TEST.MSG /MAILF=\\MyAccount\Test;TO=[email protected] Message Creation - mailto:The mailto: command is used to open a new editor window in The Bat! using pre-set parameters. mailto: is the standard Internet URL for publishing email addresses which is described in RFC 2368. This command line parameter can be used by browsers that need to open an email editor when the user clicks on a link which contains a mailto: URL. Creating New Account –/ADDThe /ADD command allows to create new accounts. All parameters correspond to account settings. Syntax /ADD:[parameter1 [;parameter2 [;parameter3 [...]]]
Example (write in a single line without space characters) /ADD; User="john"; InServer="pop3.example.com"; OutServer="smtp.example.com"; InUser="john"; InPassword="johnpass"; FromAddr="[email protected]"; FromName="John Doe"; ReplyAddr="[email protected]"; ReplyName="John Doe" Folder Maintenance - /OPThe /OP command is used to carry out folder maintenance. Syntax /OP:<parameter1>:<parameter2>:<argument> Possible parameters
Possible arguments
Examples /OP:COMPRESS:Andrew /OP:KILLDUPES:PURGE:COMPRESS:"\\My Account\Inbox" Note: You can use several parameters, but only one argument. Deleting Duplicates – /DEDUPIGNOREMSGID, /DEDUPIGNORETOMSGID, /DEDUPIGNORETO and /DEDUPIGNOREDATE/DEDUPIGNOREMSGID, /DEDUPIGNORETOMSGID, /DEDUPIGNORETO and /DEDUPIGNOREDATE are independent parameters that can be used for removing duplicates. By default, duplicates share the same Message-ID, sender (From), recipient (To) and date (Date). Messages are considered duplicates if these four attributes coincide, the other attributes are not taken into account. If two messages have different message bodies, however Message-ID, From, To and Date fields coincide, the program will delete one of these messages if you use the “remove duplicates” command. If messages do not have Message-IDs, the program checks the subjects (Subject) instead. If you use the /DEDUPIGNOREMSGID parameter, Message-ID is not checked, the program checks the From, To, Date and Subject fields. If the /DEDUPIGNORETOMSGID parameter is used, both Message-ID and recipient’s address are not checked, meaning that the program compares only sender’s address, date and subject. If the Date header is missing, the program checks the Received date. Use the /DEDUPIGNORETO parameter to check for duplicates by Message-ID, sender and date while ignoring the recipient. By executing the /DEDUPIGNOREDATE parameter the program will ignore messages' creation date and look for the duplicates with equal Message-ID, sender and recipient. Execution of Several Commands from a File - /BATCH/BATCH allows executing multiple commands defined in a text file (each command being placed in one line). Syntax /BATCH:<filepath> For example, if you want to check your account and send queued mail from it, you can create a batch file C:\The Bat!\CheckMail.BAT which contains the following lines: /CHECKMyAccount /SENDMyAccount /SMARTEXIT To execute this batch file from a command line, you can run The Bat! with the command line parameter /BATCH:“C:\The Bat!\CheckMail.BAT” Exporting and Importing Address Book or Group in LDIF-file –/LDIFIMPORT and /LDIFEXPORTSyntax /ldifexport:[parameter1[:parameter2[:parameter3[...]]] /ldifimport:[parameter1[:parameter2[:parameter3[...]]]
Examples thebat32.exe /lidfexport:ab="Main book":file="c:\exported\main.ldif" thebat64.exe /lidfimport:ab="Imported":in="c:\exported\main.ldif" You can additionally use the /LDIFNOUTF command to disable UTF-8 encoding. Sorting Messages –/REFILTERThe /REFILTER command is used for re-filtering a folder. Syntax /REFILTER[parameter1[;parameter2[;parameter3[...]]]
Example /REFILTER;F="\\Account\My Folder";IN;REPLIED Other commands - /MINIMIZE, /MIN, /EXIT, /SMARTEXIT, /NOLOGO and other/EXIT The /EXIT command is used to close The Bat! as soon as all mail transfer operations are complete. /SMARTEXIT The /SMARTEXIT command is used to close The Bat! as soon as all mail transfer operations are complete, but only if no new messages were received. /MINIMIZE The /MINIMIZE command minimizes The Bat! to the Task Bar or to the System Tray if the respective option under Options -> Preferences -> General is enabled. /MIN The /MIN command minimizes The Bat! to the Task Bar or to the System Tray if the respective option under Options -> Preferences -> General is enabled. /NOLOGO The /NOLOGO command disables the start-up screen that appears on program’s start-up. When it is used in the command line, The Bat! logo will not be displayed while program is loading its data. /OPEN Using the /OPEN command you can open a message or a vCard from a file (VCF/MSG/EML) in a separate window. Syntax /OPEN:file name Example: thebat32.exe /OPEN:"c:\My Data\message.eml" /MSGID Using the /MSGID command you can view the needed message in a separate window. You should indicate the Message-ID of this message. Syntax /MSGID:Message-ID Example: thebat64.exe /msgid:[email protected] If The Bat! does not find the message in the current folder, the program will offer to select a folder for searching. If you know the folder where the message is kept, you can either use the /FOCUS command or indicate its Message-ID and use the FOLDER parameter. Examples: thebat32.exe /FocusF="\\\General\ABC Folder"/msgid:[email protected] or thebat32.exe /msgid:[email protected]?folder="\\\General\ ABC Folder" Note: The pathname of a common folder should be specified using the following format: \\\CommonFolder\path\name\folder The pathname of a folder should be specified using the following format: \\AccountName\path\name\folder /CARDFILE The /CARDFILE command allows to send submission forms. Syntax /CARDFILE"file name" /TERMINATE The /TERMINATE command closes The Bat! even if there are active sessions in the queue. /REG Using the /reg:<name> command you can launch The Bat! from different registry key (the name of the key consists of The Bat!+<name>). For example, if you launch The Bat! using the /reg:test parameter, the key The Bat!test will be created in the Registry, and you will be able to set up The Bat! anew. /DontWriteEmailEnvironmentVariable You can configure The Bat! not to specify the %EMAIL% variable by running it with the /DontWriteEmailEnvironmentVariable command line parameter, or by setting the DWORD DontWriteEmailEnvironmentVariable variable to 1 under HKEY_CURRENT_USER\Software\RIT\The Bat! /DECRYPT_FILE_OTFE If you add this command line parameter and start The Bat! with the encrypted database, the program will prompt you to select a file from within the mail database, then it will save the decrypted copy of the selected file (adding .decrypted) in the same directory and terminate. /SMTP_DELAY_AFTER_SEND:N specifies delay in milliseconds to wait after sending each message, before sending a new message. This delay may only be made if several messages are sent during a single SMTP connection. For example, for 2-second delay, specify /SMTP_DELAY_AFTER_SEND:2000. /SMTPHOST=<domain> specifies domain passed in the SMTP greeting (EHLO/HELO). It can also be added as a line into an account's memo for account-specific use. /OFFLINE and /ONLINE are used to start/switch The Bat! into offline/online mode on start or while it's running. /SingleCEF makes The Bat! use only one CEF process. /ForceNoCEF disables CEF and enables the use of the alternative HTML viewer. /NoDirectX disables DirectX in the editor. /STARTUP_TIMING_LOG is used for tracking the program loading process and logs the startup time of each individual program element. /DebugCalDAV is used for tracing CalDAV output in ex_log.txt /TraceOAUTHFlow is used for tracing OAUTH authentication process. /debugRestore /debugSync /debugBackup are used for tracing backup and restore processes. /debugEventParsing is used for detailed scheduler event parsing. /CalendarSyncLogEvents /TraceCalendarSync /CalendarSyncLogCalendars are used for logging calendar and event lists synchronization processes. /TLS_DISABLE_PERFECT_FORWARD_SECRECY disables the cryptographic property Perfect Forward Secrecy used for secure connections (relevant for older versions only). |