Foobar2000:Commandline Guide: Difference between revisions

From Hydrogenaudio Knowledgebase
(Rewritten for 2010.)
m (Minor formatting changes.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{fb2k}}
{{fb2k}}
 
==General information==
=== General information ===
Some features of foobar2000 can be accessed through a simple command line interface.
Some features of foobar2000 can be accessed through a simple command line interface.


Each command line parameter is either parsed as a command (starting with a slash) or a file/folder name to open or add to a playlist (the behaviour depends on other command line switches and setting under "Preferences > Shell Integration"). Arguments containing spaces can be escaped using double quotes, e.g. »<tt>foobar2000.exe "01 First Track.mp3"</tt>« or »<tt>foobar2000.exe "/command:Play or pause"</tt>« or »<tt>foobar2000.exe /command:"Play or pause"</tt>«.
Each command line parameter is either parsed as a command (starting with a slash), or as the name of a file/folder that the user wishes to open or add to a playlist (the behaviour depends on other command line switches and setting under "Preferences > [[Foobar2000:Preferences:Shell_Integration|Shell Integration]]"). Arguments containing spaces can be escaped using double quotes, e.g. <code>foobar2000.exe "01 First Track.mp3"</code> or <code>foobar2000.exe "/command:Play or pause"</code> or <code>foobar2000.exe /command:"Play or pause"</code>.


The set of available command line commands can be extended using additional components.
The set of available command line commands can be extended using additional components.


==Basic commands==
This is what <code>foobar2000.exe /?</code> shows as of version 1.1 &ndash; most of the commands are self-explanatory:


=== Basic commands ===
<pre>
This is what »<tt>foobar2000.exe /?</tt>« shows as of version 1.1 &ndash; most of the commands are self-explanatory:
Available switches:
  Available switches:
  /add <list-of-files> - appends the specified files to the current playlist instead of replacing the playlist content and playing them immediately
    /add <list-of-files> - appends the specified files to the current playlist instead of replacing the playlist content and playing them immediately
  /immediate - bypasses the "please wait" dialog when adding files
    /immediate - bypasses the "please wait" dialog when adding files
  /play, /pause, /playpause, /prev, /next, /rand, /stop - playback controls
    /play, /pause, /playpause, /prev, /next, /rand, /stop - playback controls
  /exit - exits foobar2000
    /exit - exits foobar2000
  /show, /hide - shows or hides the main foobar2000 window
    /show, /hide - shows or hides the main foobar2000 window
  /config - opens the Preferences dialog
    /config - opens the Preferences dialog
  /command:<menu command> - invokes the specified main menu command
    /command:<menu command> - invokes the specified main menu command
  /playlist_command:<context menu command> - invokes the specified context menu command on current playlist selection
    /playlist_command:<context menu command> - invokes the specified context menu command on current playlist selection
  /playing_command:<context menu command> - invokes the specified context menu command on currently played track
    /playing_command:<context menu command> - invokes the specified context menu command on currently played track
  /context_command:<context menu command> <files> - invokes the specified context menu command on the specified file
    /context_command:<context menu command> <files> - invokes the specified context menu command on the specified files
</pre>
 
===== Clarifications =====
'''<tt>/add</tt>'''<br>
&nbsp;&nbsp;Changes the default behaviour of "opening" (replace active playlist and start playback) files and directories found on the command line.


'''<tt>/immediate</tt>'''<br>
===Clarifications===
&nbsp;&nbsp;&nbsp;&nbsp;foobar2000 always sorts incoming files using the pattern configured under "Preferences > Shell Integration". Because there is a possibility that more files belonging to the same batch will be passed to the program, adding the items really to a playlist is postponed until no new file is received for a short while, because only with the full set of incoming files they can be correctly sorted. Use this option to disable this behaviour for the currently added items.
;<code>/add</code>
:Changes the default behaviour of "opening" (replace active playlist and start playback) files and directories found on the command line.


'''<tt>/xxx_command:<...></tt>'''<br>
;<code>/immediate</code>
&nbsp;&nbsp;&nbsp;&nbsp;The command names can be derived e.g. from the "Preferences > Keyboard Shortcut" dialog (''[main]'' for main menu commands, ''[context]'' for the other types). Use only the final command name, do not specify any part of the path or group name. (Note this limits the usage of these commands in some cases, look at the [[Run_Commands_(foo_runcmd)|foo_runcmd]] component if you need more functionality).
:foobar2000 always sorts incoming files using the pattern configured under "Preferences > [[Foobar2000:Preferences:Shell_Integration|Shell Integration]]". Because there is a possibility that more files belonging to the same batch will be passed to the program, adding the items really to a playlist is postponed until no new file is received for a short while, because only with the full set of incoming files they can be correctly sorted. Use this option to disable this behaviour for the currently added items.


;<code>/command:<...></code> and <code>/xxx_command:<...></code>
:The command names can be derived e.g. from the "Preferences > [[Foobar2000:Preferences:General:Keyboard_Shortcuts|Keyboard Shortcuts]]" dialog: look in the sub-section ''[main]'' for main menu commands (e.g. <code>/command:Console</code>) or ''[context]'' for the other types (e.g. <code>/playing_command:Properties</code>). Use only the final command name; do not specify the name of the parent menu or any other part of the menu path/group. (Note: this limits the usage of these commands in some cases; look into the [[Foobar2000:Components_0.9/Run_Commands_(foo_runcmd)|Run Commands (foo_runcmd)]] component if you need more functionality.)


=== Extensions ===
==Extensions==
Known components which provide additional command line functionality:
Known components which provide additional command line functionality:
* [[Foobar2000:Components/Masstagger_(foo_masstag)|Masstagger (foo_masstag)]] &ndash; <tt>/tag:xxx</tt> commands for tag modifications.
* [[Foobar2000:Components/Masstagger_(foo_masstag)|Masstagger (foo_masstag)]] &ndash; <code>/tag:xxx</code> commands for tag modifications.
* [[Foobar2000:Components_0.9/Run_Commands_(foo_runcmd)|Run Commands (foo_runcmd)]] &ndash; Family of <tt>/runcmd=...</tt> commands for advanced execution of main/context menu commands.
* [[Foobar2000:Components_0.9/Run_Commands_(foo_runcmd)|Run Commands (foo_runcmd)]] &ndash; Family of <code>/runcmd=...</code> commands for advanced execution of main/context menu commands.
 
 


[[Category:foobar2000 Guides|Commandline Guide]]
[[Category:foobar2000 Guides|Commandline Guide]]

Latest revision as of 19:39, 10 June 2022

Foobar2000_Logo.png

General information

Some features of foobar2000 can be accessed through a simple command line interface.

Each command line parameter is either parsed as a command (starting with a slash), or as the name of a file/folder that the user wishes to open or add to a playlist (the behaviour depends on other command line switches and setting under "Preferences > Shell Integration"). Arguments containing spaces can be escaped using double quotes, e.g. foobar2000.exe "01 First Track.mp3" or foobar2000.exe "/command:Play or pause" or foobar2000.exe /command:"Play or pause".

The set of available command line commands can be extended using additional components.

Basic commands

This is what foobar2000.exe /? shows as of version 1.1 – most of the commands are self-explanatory:

Available switches:
  /add <list-of-files> - appends the specified files to the current playlist instead of replacing the playlist content and playing them immediately
  /immediate - bypasses the "please wait" dialog when adding files
  /play, /pause, /playpause, /prev, /next, /rand, /stop - playback controls
  /exit - exits foobar2000
  /show, /hide - shows or hides the main foobar2000 window
  /config - opens the Preferences dialog
  /command:<menu command> - invokes the specified main menu command
  /playlist_command:<context menu command> - invokes the specified context menu command on current playlist selection
  /playing_command:<context menu command> - invokes the specified context menu command on currently played track
  /context_command:<context menu command> <files> - invokes the specified context menu command on the specified file

Clarifications

/add
Changes the default behaviour of "opening" (replace active playlist and start playback) files and directories found on the command line.
/immediate
foobar2000 always sorts incoming files using the pattern configured under "Preferences > Shell Integration". Because there is a possibility that more files belonging to the same batch will be passed to the program, adding the items really to a playlist is postponed until no new file is received for a short while, because only with the full set of incoming files they can be correctly sorted. Use this option to disable this behaviour for the currently added items.
/command:<...> and /xxx_command:<...>
The command names can be derived e.g. from the "Preferences > Keyboard Shortcuts" dialog: look in the sub-section [main] for main menu commands (e.g. /command:Console) or [context] for the other types (e.g. /playing_command:Properties). Use only the final command name; do not specify the name of the parent menu or any other part of the menu path/group. (Note: this limits the usage of these commands in some cases; look into the Run Commands (foo_runcmd) component if you need more functionality.)

Extensions

Known components which provide additional command line functionality: