Command Line Options

  • Revision slug: Command_Line_Options
  • Revision title: Command Line Options
  • Revision id: 53440
  • Created:
  • Creator: SylvainPasche
  • Is current revision? No
  • Comment /* <code>-CreateProfile &quot;<var>profile_name</var> <var>profile_dir</var>&quot;</code> */ See https://bugzilla.mozilla.org/show_bug.cgi?id=381365#c4

Revision Content

You can use command line configuration options to bypass the Profile Manager and open a specific profile (if you have multiple profiles). You can also control how Mozilla application opens, which components open initially, and what the components do when they open. This page describes the commonly used options and how to use them.

How to use command options

Here is an example of command line option to open the Firefox Profile Manager:

Windows

Select Run from Windows Start menu. Type:

firefox -p

Mac OS X

Go to Applications > Utilities. Open Terminal and type:

/Applications/Firefox.app/Contents/MacOS
./firefox-bin -p

Linux

Open Terminal and type:

cd Firefox installation directory
./firefox -p

User Profile

-CreateProfile profile_name

Create a new profile named profile_name, but do not start application. profile_name must not contain spaces ( ).

firefox -CreateProfile JoelUser

-CreateProfile "profile_name profile_dir"

Creates a new profile named profile_name in the profile_dir directory, but do not start application. Note profile_name and profile_dir are quoted together.

NOTE: profile_dir must not exist and you must not already have a profile called profile_name.

firefox -CreateProfile "JoelUser c:\internet\moz-profile"

-ProfileManager or -p

Start with Profile Manager.

-SelectProfile

Start with the profile selection dialog. SeaMonkey only.

-ProfileWizard

Start with Profile Wizard. SeaMonkey only.

-p "profile_name"

Bypass Profile Manager and launch application with the profile named profile_name. Useful for dealing with multiple profiles. Note profile_name is case sensitive.

firefox -p "Joel User"

-profile "/path/to/profile"

Start with a profile with the given path. Firefox and Thunderbird only.

-no-remote

Allows multiple copies of application to be open at a time. Firefox and Thunderbird only.

firefox -no-remote -p "Another Profile"

-migration

Start with Import Wizard. Firefox and Thunderbird only.

-installer

Start with the Netscape 4.x migration window. SeaMonkey only.

-resetPref preference

Reset the specified preference (comma-separated) to the default value. SeaMonkey only.

seamonkey -resetPref browser.startup.homepage

Browser

-browser

Start with the browser component. Firefox and SeaMonkey only.

-url URL

Open URL with browser. -url can be omitted. Firefox and SeaMonkey only.

firefox www.mozilla.com

-new-tab URL

Open URL in a new tab. Firefox only.

-new-window URL

Open URL in a new tab or window, depend on the browser option. Firefox only.

-search term

Search term with your default search engine. Firefox only.

-preferences

Open Options/Preferences window. Firefox only.

-setDefaultBrowser

Set the application as the default browser. Firefox only.

Mail/News

-mail

Start with the mail client. Thunderbird and SeaMonkey only.

-mail mailto_URL

Start the Compose Message window for the given mailto_URL Thunderbird and SeaMonkey only.

thunderbird -mail mailto:me@isp.net?subject=hi

-news news_URL

Start with the news client. If news_URL (optional) is given, open the specified newsgroup. Thunderbird and SeaMonkey only.

thunderbird -news news://server/group

-compose message_options

Start with mail composer. See syntax rules. Thunderbird and SeaMonkey only.

thunderbird -compose "to=foo@nowhere.net"

-addressbook

Start with address book. Thunderbird and SeaMonkey only.

-options

Open Options/Preferences window. Thunderbird only.

-offline

Start with the offline mode. Thunderbird only.

-setDefaultMail

Set the application as the default email client. Thunderbird only.

Calendar

-calendar

Start with the calendar client. Sunbird only.

-subscribe URL or -url URL

Subscribe to the given URL. Sunbird only.

-showdate date

Show your schedule of the given date. Sunbird only.

Other Components

-editor URL or -edit URL

Start with editor (Composer) for the given URL (where URL is optional). SeaMonkey only.

seamonkey -edit www.mozilla.org

-jsconsole

Start application with the Error Console.

-inspector URL

Start with the DOM Inspector, if installed, and inspect the given URL (where URL is optional).

-venkman

Start with the JavaScript debugger, Venkman, if installed.

-chat

Start with the IRC client, ChatZilla, if installed.

Chrome

-chrome chrome_URL

Load the specified chrome.

firefox -chrome chrome://inspector/content

-register chrome_URL

Register the specified chrome, but do not start application.

Add-on

-install-global-extension /path/to/extension

Installs the extension into the application directory. The parameter is the path to the extension. You must have administrative privileges. Firefox and Thunderbird only.

-install-global-theme /path/to/theme

Same as above, but for themes. You must have administrative privileges. Firefox and Thunderbird only.

Since Firefox 2.0.0.7, use of the -install-global-extension and -install-global-theme command line arguments have been restricted to only allow installing add-ons that are on local disks or mapped drives. Installing from a network share directly will no longer succeed.

-safe-mode

Launches the application with all extensions disabled, for that launch only. (Extensions are not loaded, but are not permanently disabled in the Extension Manager data source). Firefox and Thunderbird only.

Locale

-UILocale locale

Start with locale resources as UI Locale.

firefox -UILocale en-US

-contentLocale locale

Start with locale resources as content Locale.

firefox -contentLocale en-US

Appearance

-height xxx

Set window height.

firefox -height 600

-width xxx

Set window width.

firefox -width 800

Startup

-turbo

Launch application in Quick Launch mode. SeaMonkey only.

-nosplash or -quiet

Suppresses display of the splash screen. To show splash screen, use the -splash command. Note the splash screen is disabled by default on some systems. SeaMonkey only.

Remote Control

-remote remote_command

Execute remote_command in an already running application process (see remote control). Unix/Linux only.

firefox -remote "openURL(www.mozilla.org, new-tab)"

Miscellaneous

-console

Start application with a debugging console.

-h or -help or -?

Print the list of all available command line options. Note that on Windows this only work with debug builds ({{template.Bug(355889)}}). This option is available only in command console.

-v or -version

Print application version. Note that on Windows this only work with debug builds ({{template.Bug(355889)}}).

Other options need to be documented

  • -print-xpcom-dir
  • -print-xpcom-dirlist
  • -silent
  • -osint
  • -requestPending
  • -kill
  • -killAll
  • -f
  • -ftimeout
  • -fwait
  • -unsetDefaultMail
  • -override
  • -foreground
  • GTK options
  • X11 options

Syntax Rules

  • Command parameters containing spaces must be enclosed in quotes; for example, "Joel User".
  • Command actions are not case sensitive.
  • Command parameters except profile names are not case sensitive.
  • Blank spaces ( ) separate commands and parameters.
  • Each message option follows the syntax field=value, for example:
    • to=foo@nowhere.net
    • subject=cool page
    • attachment=www.mozilla.org
    • attachment='file:///c:/test.txt'
    • body=check this page
  • Multiple message options are separated by comma (,), for example: "to=foo@nowhere.net,subject=cool page" . Comma separators must not follow or precede spaces ( ). To assign multiple values to a field, enclose the values in single quotes ('), for example: "to='foo@nowhere.net,foo@foo.de',subject=cool page" .

References

Original Document Information

  • Author(s): Ben Goodger, Steffen Wilberg, Seth Spitzer, Daniel Wang
  • Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details.
{{ wiki.languages( { "ja": "ja/Command_Line_Options" } ) }}

Revision Source

<p>You can use command line configuration options to bypass the Profile Manager and open a specific profile (if you have multiple profiles). You can also control how Mozilla application opens, which components open initially, and what the components do when they open. This page describes the commonly used options and how to use them.
</p>
<h3 name="How_to_use_command_options"> How to use command options </h3>
<p>Here is an example of command line option to open the Firefox Profile Manager:
</p>
<h4 name="Windows"> Windows </h4>
<p>Select Run from Windows Start menu. Type:
</p>
<pre class="eval">firefox -p
</pre>
<h4 name="Mac_OS_X"> Mac OS X </h4>
<p>Go to Applications &gt; Utilities. Open Terminal and type:
</p>
<pre class="eval">/Applications/Firefox.app/Contents/MacOS
./firefox-bin -p
</pre>
<h4 name="Linux"> Linux </h4>
<p>Open Terminal and type:
</p>
<pre class="eval">cd <var>Firefox installation directory</var>
./firefox -p
</pre>
<h3 name="User_Profile"> User Profile </h3>
<h4 name="-CreateProfile_profile_name"> <code>-CreateProfile <var>profile_name</var></code> </h4>
<p>Create a new profile named <var>profile_name</var>, but do not start application. <var>profile_name</var> must not contain spaces ( ).
</p>
<pre class="eval">firefox -CreateProfile JoelUser
</pre>
<h4 name="-CreateProfile_.22profile_name_profile_dir.22"> <code>-CreateProfile "<var>profile_name</var> <var>profile_dir</var>"</code> </h4>
<p>Creates a new profile named <var>profile_name</var> in the <var>profile_dir</var> directory, but do not start application. Note <var>profile_name</var> and <var>profile_dir</var> are quoted together.
</p><p>NOTE: <var>profile_dir</var> must not exist and you must not already have a profile called <var>profile_name</var>.
</p>
<pre class="eval">firefox -CreateProfile "JoelUser c:\internet\moz-profile"
</pre>
<h4 name="-ProfileManager_or_-p"> <code>-ProfileManager</code> or <code>-p</code> </h4>
<p>Start with Profile Manager.
</p>
<h4 name="-SelectProfile"> <code>-SelectProfile</code> </h4>
<p>Start with the profile selection dialog. <b>SeaMonkey</b> only.
</p>
<h4 name="-ProfileWizard"> <code>-ProfileWizard</code> </h4>
<p>Start with Profile Wizard. <b>SeaMonkey</b> only.
</p>
<h4 name="-p_.22profile_name.22"> <code>-p "<var>profile_name</var>"</code> </h4>
<p>Bypass Profile Manager and launch application with the profile named <var>profile_name</var>. Useful for dealing with multiple profiles. Note <var>profile_name</var> is case sensitive.
</p>
<pre class="eval">firefox -p "Joel User"
</pre>
<h4 name="-profile_.22.2Fpath.2Fto.2Fprofile.22"> <code>-profile "<var>/path/to/profile</var>"</code> </h4>
<p>Start with a profile with the given path. <b>Firefox</b> and <b>Thunderbird</b> only.
</p>
<h4 name="-no-remote"> <code>-no-remote</code> </h4>
<p>Allows multiple copies of application to be open at a time. <b>Firefox</b> and <b>Thunderbird</b> only.
</p>
<pre class="eval">firefox -no-remote -p "Another Profile"
</pre>
<h4 name="-migration"> <code>-migration</code> </h4>
<p>Start with Import Wizard. <b>Firefox</b> and <b>Thunderbird</b> only.
</p>
<h4 name="-installer"> <code>-installer</code> </h4>
<p>Start with the Netscape 4.x migration window. <b>SeaMonkey</b> only.
</p>
<h4 name="-resetPref_preference"> <code>-resetPref <var>preference</var></code> </h4>
<p>Reset the specified <var>preference</var> (comma-separated) to the default value. <b>SeaMonkey</b> only.
</p>
<pre class="eval">seamonkey -resetPref browser.startup.homepage
</pre>
<h3 name="Browser"> Browser </h3>
<h4 name="-browser"> <code>-browser</code> </h4>
<p>Start with the browser component. <b>Firefox</b> and <b>SeaMonkey</b> only.
</p>
<h4 name="-url_URL"> <code>-url <var>URL</var></code> </h4>
<p>Open <var>URL</var> with browser. <code>-url</code> can be omitted. <b>Firefox</b> and <b>SeaMonkey</b> only.
</p>
<pre class="eval">firefox www.mozilla.com
</pre>
<h4 name="-new-tab_URL"> <code>-new-tab <var>URL</var></code> </h4>
<p>Open <var>URL</var> in a new tab. <b>Firefox</b> only.
</p>
<h4 name="-new-window_URL"> <code>-new-window <var>URL</var></code> </h4>
<p>Open <var>URL</var> in a new tab or window, depend on the browser option. <b>Firefox</b> only.
</p>
<h4 name="-search_term"> <code>-search <var>term</var></code> </h4>
<p>Search <var>term</var> with your default search engine. <b>Firefox</b> only.
</p>
<h4 name="-preferences"> <code>-preferences</code> </h4>
<p>Open Options/Preferences window. <b>Firefox</b> only.
</p>
<h4 name="-setDefaultBrowser"> <code>-setDefaultBrowser</code> </h4>
<p>Set the application as the default browser. <b>Firefox</b> only.
</p>
<h3 name="Mail.2FNews"> Mail/News </h3>
<h4 name="-mail"> <code>-mail</code> </h4>
<p>Start with the mail client. <b>Thunderbird</b> and <b>SeaMonkey</b> only.
</p>
<h4 name="-mail_mailto_URL"> <code>-mail <var>mailto_URL</var></code> </h4>
<p>Start the Compose Message window for the given <var>mailto_URL</var> <b>Thunderbird</b> and <b>SeaMonkey</b> only.
</p>
<pre class="eval">thunderbird -mail <span class="plain">mailto:me@isp.net?subject=hi</span>
</pre>
<h4 name="-news_news_URL"> <code>-news</code> <var>news_URL</var> </h4>
<p>Start with the news client. If <var>news_URL</var> (optional) is given, open the specified newsgroup. <b>Thunderbird</b> and <b>SeaMonkey</b> only.
</p>
<pre class="eval">thunderbird -news <span class="plain">news://server/group</span>
</pre>
<h4 name="-compose_message_options"> <code>-compose <var>message_options</var></code> </h4>
<p>Start with mail composer. See <a href="#Syntax_Rules">syntax rules</a>. <b>Thunderbird</b> and <b>SeaMonkey</b> only.
</p>
<pre class="eval">thunderbird -compose "to=foo@nowhere.net"
</pre>
<h4 name="-addressbook"> <code>-addressbook</code> </h4>
<p>Start with address book. <b>Thunderbird</b> and <b>SeaMonkey</b> only.
</p>
<h4 name="-options"> <code>-options</code> </h4>
<p>Open Options/Preferences window. <b>Thunderbird</b> only.
</p>
<h4 name="-offline"> <code>-offline</code> </h4>
<p>Start with the offline mode. <b>Thunderbird</b> only.
</p>
<h4 name="-setDefaultMail"> <code>-setDefaultMail</code> </h4>
<p>Set the application as the default email client. <b>Thunderbird</b> only.
</p>
<h3 name="Calendar"> Calendar </h3>
<h4 name="-calendar"> <code>-calendar</code> </h4>
<p>Start with the calendar client. <b>Sunbird</b> only.
</p>
<h4 name="-subscribe_URL_or_-url_URL"> <code>-subscribe <var>URL</var></code> or <code>-url <var>URL</var></code> </h4>
<p>Subscribe to the given <var>URL</var>. <b>Sunbird</b> only.
</p>
<h4 name="-showdate_date"> <code>-showdate <var>date</var></code> </h4>
<p>Show your schedule of the given <var>date</var>. <b>Sunbird</b> only.
</p>
<h3 name="Other_Components"> Other Components </h3>
<h4 name="-editor_URL_or_-edit_URL"> <code>-editor <var>URL</var></code> or <code>-edit <var>URL</var></code> </h4>
<p>Start with editor (Composer) for the given <var>URL</var> (where <var>URL</var> is optional). <b>SeaMonkey</b> only.
</p>
<pre class="eval">seamonkey -edit www.mozilla.org
</pre>
<h4 name="-jsconsole"> <code>-jsconsole</code> </h4>
<p>Start application with the <a href="en/Error_Console">Error Console</a>.
</p>
<h4 name="-inspector_URL"> <code>-inspector <var>URL</var></code> </h4>
<p>Start with the <a href="en/DOM_Inspector">DOM Inspector</a>, if installed, and inspect the given <var>URL</var> (where <var>URL</var> is optional).
</p>
<h4 name="-venkman"> <code>-venkman</code> </h4>
<p>Start with the JavaScript debugger, <a href="en/Venkman">Venkman</a>, if installed.
</p>
<h4 name="-chat"> <code>-chat</code> </h4>
<p>Start with the IRC client, <a class="external" href="https://addons.mozilla.org/en-US/firefox/addon/16">ChatZilla</a>, if installed.
</p>
<h3 name="Chrome"> Chrome </h3>
<h4 name="-chrome_chrome_URL"> <code>-chrome <var>chrome_URL</var></code> </h4>
<p>Load the specified chrome.
</p>
<pre class="eval">firefox -chrome chrome://inspector/content
</pre>
<h4 name="-register_chrome_URL"> <code>-register <var>chrome_URL</var></code> </h4>
<p>Register the specified chrome, but do not start application.
</p>
<h3 name="Add-on"> Add-on </h3>
<h4 name="-install-global-extension_.2Fpath.2Fto.2Fextension"> <code>-install-global-extension <var>/path/to/extension</var></code> </h4>
<p>Installs the extension into the application directory. The parameter is the path to the extension. You must have administrative privileges. <b>Firefox</b> and <b>Thunderbird</b> only.
</p>
<h4 name="-install-global-theme_.2Fpath.2Fto.2Ftheme"> <code>-install-global-theme <var>/path/to/theme</var></code> </h4>
<p>Same as above, but for themes. You must have administrative privileges. <b>Firefox</b> and <b>Thunderbird</b> only.
</p>
<div class="note">
<p>Since Firefox 2.0.0.7, use of the <code>-install-global-extension</code> and <code>-install-global-theme</code> command line arguments have been restricted to only allow installing add-ons that are on local disks or mapped drives. Installing from a network share directly will no longer succeed. <a class="external" href="http://www.mozilla.com/en-US/firefox/2.0.0.7/releasenotes/#issues">
</a></p><a class="external" href="http://www.mozilla.com/en-US/firefox/2.0.0.7/releasenotes/#issues">
</a></div><a class="external" href="http://www.mozilla.com/en-US/firefox/2.0.0.7/releasenotes/#issues">
<h4 name="-safe-mode"> <code>-safe-mode</code> </h4>
<p>Launches the application with all extensions disabled, for that launch only. (Extensions are not loaded, but are not permanently disabled in the Extension Manager data source). <b>Firefox</b> and <b>Thunderbird</b> only.
</p>
<h3 name="Locale"> Locale </h3>
<h4 name="-UILocale_locale"> <code>-UILocale <var>locale</var></code> </h4>
<p>Start with <var>locale</var> resources as UI Locale.
</p>
<pre class="eval">firefox -UILocale en-US
</pre>
<h4 name="-contentLocale_locale"> <code>-contentLocale <var>locale</var></code> </h4>
<p>Start with <var>locale</var> resources as content Locale.
</p>
<pre class="eval">firefox -contentLocale en-US
</pre>
<h3 name="Appearance"> Appearance </h3>
<h4 name="-height_xxx"> <code>-height <var>xxx</var></code> </h4>
<p>Set window height.
</p>
<pre class="eval">firefox -height 600
</pre>
<h4 name="-width_xxx"> <code>-width <var>xxx</var></code> </h4>
<p>Set window width.
</p>
<pre class="eval">firefox -width 800
</pre>
<h3 name="Startup"> Startup </h3>
<h4 name="-turbo"> <code>-turbo</code> </h4>
<p>Launch application in Quick Launch mode. <b>SeaMonkey</b> only.
</p>
<h4 name="-nosplash_or_-quiet"> <code>-nosplash</code> or <code>-quiet</code> </h4>
<p>Suppresses display of the splash screen. To show splash screen, use the <code>-splash</code> command. Note the splash screen is disabled by default on some systems. <b>SeaMonkey</b> only.
</p>
<h3 name="Remote_Control"> Remote Control </h3>
<h4 name="-remote_remote_command"> <code>-remote <var>remote_command</var></code> </h4>
</a><p><a class="external" href="http://www.mozilla.com/en-US/firefox/2.0.0.7/releasenotes/#issues">Execute <var>remote_command</var> in an already running application process (see </a><a class="external" href="http://www.mozilla.org/unix/remote.html">remote control</a>). Unix/Linux only.
</p>
<pre class="eval">firefox -remote "openURL(www.mozilla.org, new-tab)"
</pre>
<h3 name="Miscellaneous"> Miscellaneous </h3>
<h4 name="-console"> <code>-console</code> </h4>
<p>Start application with a debugging console.
</p>
<h4 name="-h_or_-help_or_-.3F"> <code>-h</code> or <code>-help</code> or <code>-?</code> </h4>
<p>Print the list of all available command line options. Note that on Windows this only work with debug builds ({{template.Bug(355889)}}). This option is available only in command console.
</p>
<h4 name="-v_or_-version"> <code>-v</code> or <code>-version</code> </h4>
<p>Print application version. Note that on Windows this only work with debug builds ({{template.Bug(355889)}}).
</p>
<h3 name="Other_options_need_to_be_documented"> Other options need to be documented </h3>
<ul><li> <code>-print-xpcom-dir</code>
</li><li> <code>-print-xpcom-dirlist</code>
</li><li> <code>-silent</code>
</li><li> <code>-osint</code>
</li><li> <code>-requestPending</code>
</li><li> <code>-kill</code>
</li><li> <code>-killAll</code>
</li><li> <code>-f</code>
</li><li> <code>-ftimeout</code>
</li><li> <code>-fwait</code>
</li><li> <code>-unsetDefaultMail</code>
</li><li> <code>-override</code>
</li><li> <code>-foreground</code>
</li><li> GTK options
</li><li> X11 options
</li></ul>
<h3 name="Syntax_Rules"> Syntax Rules </h3>
<ul><li> Command parameters containing spaces must be enclosed in quotes; for example, "Joel User".
</li><li> Command actions are not case sensitive.
</li><li> Command parameters except profile names are not case sensitive.
</li><li> Blank spaces ( ) separate commands and parameters.
</li><li> Each message option follows the syntax <code><var>field</var>=<var>value</var></code>, for example:
<ul><li> <code>to=foo@nowhere.net</code>
</li><li> <code>subject=cool page</code>
</li><li> <code>attachment=www.mozilla.org</code>
</li><li> <code>attachment='file:///c:/test.txt'</code>
</li><li> <code>body=check this page</code>
</li></ul>
</li><li> Multiple message options are separated by comma (,), for example: <code>"to=foo@nowhere.net,subject=cool page"</code> . Comma separators must not follow or precede spaces ( ). To assign multiple values to a field, enclose the values in single quotes ('), for example: <code>"to='foo@nowhere.net,foo@foo.de',subject=cool page"</code> .
</li></ul>
<h3 name="References"> References </h3>
<ul><li> <a href="en/Chrome/Command_Line">Chrome: Command Line</a>
</li><li> <a class="external" href="http://www.mozilla.org/quality/browser/front-end/testcases/cmd-line/">Test Documentation for Command-line Features</a> (mozilla.org)
</li><li> <a class="external" href="http://support.mozilla.com/kb/Command+line+arguments">Command line arguments</a> (Mozilla Support)
</li><li> {{template.Source("toolkit/xre/nsAppRunner.cpp")}}
</li><li> {{template.Source("browser/components/nsBrowserContentHandler.js")}}
</li><li> {{template.Source("mail/components/nsMailDefaultHandler.js")}}
</li></ul>
<div class="originaldocinfo">
<h2 name="Original_Document_Information"> Original Document Information </h2>
<ul><li> Author(s): Ben Goodger, Steffen Wilberg, Seth Spitzer, Daniel Wang
</li><li> Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | <a class="external" href="http://www.mozilla.org/foundation/licensing/website-content.html">Details</a>.
</li></ul>
</div>
{{ wiki.languages( { "ja": "ja/Command_Line_Options" } ) }}
Revert to this revision