Command line arguments: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(→‎Command line arguments (incomplete): added -install-global-extension)
m (tidying)
Line 1: Line 1:
You can use command line arguments to change the way Firefox, Thunderbird, and Mozilla Suite start.
You can use ''command line arguments'' to start your Mozilla application with special behaviour.


==How to use command line arguments==
==How to use command line arguments==
===For Windows users===
===For Windows users===
* Go to "Start -> Run" and entering the what you wish to execute with the switch. For example,  
* Go to "Start -> Run" and enter the file path and file name of the application, followed by the command line arguments. For example,  
  "C:\Program Files\Mozilla\Mozilla.exe" -ProfileManager
  "C:\Program Files\Mozilla Firefox\firefox.exe" -ProfileManager
(with the quotation marks).
(including the quotation marks). In this example the file path to the [[installation directory]] is C:\Program Files\Mozilla Firefox, the file name of the Firefox application is firefox.exe, and the command line argument we are using is ProfileManager. You should place a hyphen (-) directly before each command line argument that you wish to use.
* You may also create a shortcut on your Desktop or wherever you like to make this less tedious. Right click on an open space. Choose New -> Shortcut. Follow the wizard in creating a new shortcut. When it prompts you for location (not name), type what you want to execute. For an example, see above.
* If you regularly wish to start your application using command line arguments then you can also create a shortcut on your Desktop which includes them. To do this, right-click on an open space of the desktop and choose "New -> Shortcut". Follow the wizard to create the new shortcut. When it prompts you for location (not name), type the file path and file name followed by the command line arguments, exactly as in the example above.


===For Linux and Mac OS X users===
===For Linux and Mac OS X users===
* Go to your Terminal window and type what you want to execute. On Linux, the shortcuts to your Terminal window will vary in location depending on your desktop environment. On Mac OS X go to your Applications/Utilities folder and choose "Terminal".
* Go to your Terminal window and type what you want to execute. On Linux, the shortcuts to your Terminal window will vary in location depending on your desktop environment. On Mac OS X go to your Applications/Utilities folder and choose "Terminal".


==Command line arguments (incomplete)==
==List of command line arguments (incomplete)==
  {| {{prettytable}}
  {| {{prettytable}}
  ! Command
  ! Command
Line 18: Line 17:
  ! Example
  ! Example
  |-
  |-
  | profile "path"
  | profile "<path>"
  | Starts firefox with profile located at the given path.
  | Starts firefox with profile located at the given path.
  | firefox.exe -profile "E:\myprofile"
  | firefox.exe -profile "E:\myprofile"
  |-  
  |-  
  | P "profile name"  
  | P "<profile name>"  
  | Starts firefox with a given profile name (profile name is case sensitive).
  | Starts firefox with a given profile name (profile name is case sensitive).
  | firefox.exe -P "Joel User"
  | firefox.exe -P "Joel User"
  |-
  |-
  | url
  | <url>
  | Launches firefox and opens the given URL(s).
  | Launches firefox and opens the given URL(s).
  | firefox.exe <nowiki>"www.mozilla.org|www.mozillazine.org"</nowiki>
  | firefox.exe <nowiki>"www.mozilla.org|www.mozillazine.org"</nowiki>
Line 74: Line 73:
  | firefox.exe -new
  | firefox.exe -new
  |-
  |-
  | -install-global-extension
  | install-global-extension "<path>"
  | Install an extension globally.
  | Install an extension globally.
  | firefox.exe -install-global-extension "<path-to-extension>\extension-file.xpi"
  | firefox.exe -install-global-extension "C:\Temp\extension-file.xpi"
  |}
  |}



Revision as of 17:21, 10 January 2006

You can use command line arguments to start your Mozilla application with special behaviour.

How to use command line arguments

For Windows users

  • Go to "Start -> Run" and enter the file path and file name of the application, followed by the command line arguments. For example,
"C:\Program Files\Mozilla Firefox\firefox.exe" -ProfileManager

(including the quotation marks). In this example the file path to the installation directory is C:\Program Files\Mozilla Firefox, the file name of the Firefox application is firefox.exe, and the command line argument we are using is ProfileManager. You should place a hyphen (-) directly before each command line argument that you wish to use.

  • If you regularly wish to start your application using command line arguments then you can also create a shortcut on your Desktop which includes them. To do this, right-click on an open space of the desktop and choose "New -> Shortcut". Follow the wizard to create the new shortcut. When it prompts you for location (not name), type the file path and file name followed by the command line arguments, exactly as in the example above.

For Linux and Mac OS X users

  • Go to your Terminal window and type what you want to execute. On Linux, the shortcuts to your Terminal window will vary in location depending on your desktop environment. On Mac OS X go to your Applications/Utilities folder and choose "Terminal".

List of command line arguments (incomplete)

Command Result Example
profile "<path>" Starts firefox with profile located at the given path. firefox.exe -profile "E:\myprofile"
P "<profile name>" Starts firefox with a given profile name (profile name is case sensitive). firefox.exe -P "Joel User"
<url> Launches firefox and opens the given URL(s). firefox.exe "www.mozilla.org|www.mozillazine.org"
safe-mode Launches firefox without loading extensions or themes. firefox.exe -safe-mode
height <value> Set height of startup window to <value>. firefox.exe -height 600
width <value> Set width of startup window to <value>. firefox.exe -width 800
ProfileManager Start with Profile Manager. firefox.exe -ProfileManager
UILocale <locale> Start with <locale> resources as UI Locale. firefox.exe -UILocale th-TH
contentLocale <locale> Start with <locale> resources as content Locale. firefox.exe -contentLocale TH
console Start Mozilla with a debugging console. firefox.exe -console
jsconsole Start with Javascript Console. firefox.exe -jsconsole
inspector <url> Start with the DOM Inspector. firefox.exe -inspector http://www.google.com/
chrome <url> Load the specified chrome. firefox.exe -chrome chrome://inspector/content/inspector.xul
new Load a new browser window. firefox.exe -new
install-global-extension "<path>" Install an extension globally. firefox.exe -install-global-extension "C:\Temp\extension-file.xpi"

See also

External links