Difference between revisions of "The Command Line"

From JRiverWiki
Jump to: navigation, search
(added /restart)
Line 1: Line 1:
Media Center can be controlled by command line parameters sent to the appropriate command launcher:
+
Media Center and Media Jukebox can be controlled by command line parameters sent using a command launcher.  The launcher is installed during installation of main application.  The command launcher is version-specific, and installed in the standard system directory.  The name of the command launcher for Media Center follows the (case-insensitive) form:
  
* Media Center 15 - '''mc15.exe'''
+
<code>'''MC'''''<MC version>'''''.exe'''</code>
* Media Center 14 - '''mc14.exe'''
 
* Media Center 13 - '''mc13.exe'''
 
* Media Center 12 - '''mc12.exe'''
 
* Media Center 11 - '''mc11.exe'''
 
* Media Jukebox 12 - '''mj12.exe'''
 
* Media Jukebox - '''mjextman.exe'''
 
  
'''NOTE:''' replace all instances of '''mc15.exe''' in this document with the appropriate command launcher for your version.  Also, note that the command launcher for the particular application version you are using is '''not''' located in the application installation directory (inside <tt>C:\Program Files\</tt> for example) but is instead found in your standard system directory.  This is often found at <tt>C:\WINDOWS\system32\</tt> for most Windows installations.  However, because the System directory would normally be found in your system's "path" it is not normally necessary to specify the full path when calling the command launcher.
+
and for Media Jukebox version 12 and beyond:
  
==Execute Parameters==
+
<code>'''MJ'''''<MJ version>'''''.exe'''</code>
Executing mc15.exe with one of the following command line parameters first starts Media Center if it is not already running.
 
  
===Playback Execute Parameters===
+
and finally, prior to version 12 of Media Jukebox, the launcher is named:
'''mc15.exe [''item'']|[''item'']...''' If playback is currently stopped, Playing Now is replaced with the item(s) and playback starts, otherwise the item(s) are appended to Playing Now and playback jumps to the first specified item.
 
  
'''mc15.exe /Append [''item'']|[''item'']...''' Appends item(s) to Playing Now without changing the current playback state.
+
<code>'''mjextman.exe'''</code>
  
'''mc15.exe /AudioCD'''
+
Notes
 +
* The text that follows in this document will assume the usage of '''mc16.exe''', the launcher for Media Center 16.  Use the appropriate command for your version of Media Center or Media Jukebox.
  
'''mc15.exe /Clear [mode]''' Removes all files from Playing Now and stops playback.
+
* The command launcher is installed into the system directory, typically <tt>C:\WINDOWS\system32\</tt> (it does not reside in the application directory). Because the system directory is normally included in your system's PATH variable, it is not necessary to specify the full path when invoking the command launcher.
  
:The only available [mode] is:
+
==Command Line Options and Parameters==
:* '''DontRemoveCurrent''' Does not remove the currently playing file and does not stop playback.
+
Executing '''mc16.exe''' with one of the following command line options / parameters first starts Media Center if it is not already running (exception; see '''/Command''' below).
  
'''mc15.exe /Close''' Closes Media Center.
+
Some options below accept a parameter ''<items>'', which is a list of one or more items, each item separated by a '''|''' (vertical bar, or pipe).  Through the text, each item in ''<items>'' can be any of the following:
 +
:* A filename: Example: '''C:\song1.mp3'''
 +
:* A URL: Example: '''http:\\www.somewebsite.com\station.pls'''
 +
:* A location within the Organization Tree: Example: '''TREEPATH=Playlists\Playlist1'''
 +
:: The '''TREEPATH='''''<location>'''''\'''''<item>'' specification is case-sensitive for ''<location>'' and ''<item>'' and the hierarchy separator is '''\''' (backslash).
 +
:* A device under CD & DVD and Handhelds: Example: '''DEVICE=G:'''
  
'''mc15.exe /Connect m01p://[ip address or host name]''' Establishes a connection to the specified  remote Media Server.
+
Each item in ''<items>'' may be targetted to a specific Zone by appending the item with '''Zone='''''<x>'', where ''<x>'' is replaced by the Zone number (Media Center 10 or later).
  
'''mc15.exe /DVDVideo'''
+
Example: mc16.exe /Append C:\1.mp3|C:\2.mp3|Zone=3
  
'''mc15.exe /ExportToXML [filename]''' Exports the current library as XML (in the MPL format) to the specified filename.  If the program is not running, it will perform this command and silently exit.
 
  
'''mc15.exe /Import [filename]''' Imports the specified file into the Media Center library and launches Media Center.
+
{| border="1" cellpadding="3" cellspacing="0"
 +
!Option !! Parameter !! Description
 +
|-
 +
| /Append || ''<items>'' || Appends item(s) to Playing Now without changing the current playback state.
 +
|-
 +
| /AudioCD || ||
 +
|-
 +
| /Clear || ''<mode>'' || Removes all files from Playing Now and stops playback.
  
'''mc15.exe /ImportAndPlay'''
+
:Values for ''<mode>'' :
 +
:* '''DontRemoveCurrent''' Does not remove the currently playing file and does not stop playback.
 +
|-
 +
| /Close || || Closes Media Center.
 +
|-
 +
| rowspan="14" | /Command
 +
| colspan="2" | '''Note: the /Command option has no effect if Media Center is not already running.'''
 +
|-
 +
| Play || Starts playback of the selected track(s).
 +
|-
 +
| Pause || Toggles between play and pause states.
 +
|-
 +
| Stop || Stops playback.
 +
|-
 +
| Next || Skips to the next track.
 +
|-
 +
| Previous || Skips to the previous track.
 +
|-
 +
| FastForward || Jumps 5 seconds forward.
 +
|-
 +
| Rewind || Jumps 5 seconds backward.
 +
|-
 +
| Mute || Mutes the sound.
 +
|-
 +
| VolumeUp ''<percent>'' || Increases the sound volume by ''<percent>'' percent.  Default: 5%.
 +
|-
 +
| style="white-space:nowrap" | VolumeDown ''<percent>'' || Decreases the sound volume by ''<percent> percent''.  Default: 5%.
 +
|-
 +
| VolumeSet ''<percent>'' || Sets the sound volume directly to ''<percent>'' percent.  Default: 50%.
 +
|-
 +
| ToggleShuffle || Toggles shuffle mode
 +
|-
 +
| ToggleContinuous ||  Toggles continuous mode
 +
|-
 +
| /Connect || m01p://''<host>'' || Establishes a connection to ''<host>'', a hostname or IP address that specifies the remote Media Server.
 +
|-
 +
| /DVDVideo || ||
 +
|-
 +
| /ExportToXML || ''<filename>'' || Exports the current library as XML (in the MPL format) to the specified file ''<filename>''.  If the program is not running, the command is performed silently, and the program exits.
 +
|-
 +
| /Import || ''<filename>'' || Imports the specified file into the Media Center library and launches Media Center.
 +
|-
 +
| /ImportAndPlay || ||
 +
|-
 +
| /Library || ''<library name>'' || Changes to the library specified by ''<library name>'' (Media Center 12.0.384 and later).
 +
|-
 +
| /LibraryReadOnly || || Starts Media Center with the library in read-only mode (aka. Party Mode).
 +
|-
 +
| /MCC || style="white-space:nowrap" | ''<command>'', ''<param>'' || Sends the specified Media Center Core Command to Media Center.
  
'''mc15.exe /Library [Library Name]''' Changes to the library specified by '''[Library Name]''' (Media Center 12.0.384 and later).
+
:''<command>'' is one of the [[Media_Center_Core_Commands|Media Center Core Commands]].
  
'''mc15.exe /LibraryReadOnly''' Starts Media Center with the library read only (Party Mode).
+
:''<param>'' is optional, and defaults to 0.
  
'''mc15.exe /MCC [command],[param]''' Sends the specified Media Center Core Command to Media Center.
+
:Note: Only available in Media Center.
 +
|-
 +
| /MediaServer || || Starts Media Center in Media Server mode (without a UI).
 +
|-
 +
| /Mime || ||
 +
|-
 +
| /Mode || ''<modename>'' || Sets the Media Center mode to ''<modename>''.  Media Center will be started if it is not running.
  
:[command] is one of the [[Media_Center_Core_Commands|Media Center Core Commands]].
+
:Select ''<modename>'' from one of the following:  
 
+
:* '''Standard''', '''Megame''', or '''Windowed''' Standard View
:[param] is optional, and defaults to 0.
 
 
 
:Note: These are only available in Media Center.
 
 
 
'''mc15.exe /MediaServer''' Starts Media Center in Media Server mode (without a UI).
 
 
 
'''mc15.exe /Mime'''
 
 
 
'''mc15.exe /Mode [modename]''' If Media Center is not currently running, this starts Media Center in the specified mode, otherwise this switches Media Center to the specified mode.
 
 
 
:[modename] can be one of the following:
 
:* '''Standard, Megame, or Windowed''' Standard View
 
 
:* '''Minime''' Mini View
 
:* '''Minime''' Mini View
 
:* '''Fullscreen''' Display View
 
:* '''Fullscreen''' Display View
 
:* '''Theater''' Theater View
 
:* '''Theater''' Theater View
  
:Note: An empty [modename] is the same as the user's chosen startup mode if Media Center is not running, or Standard if it is already running.
+
:Note: An empty ''<modename>'' is the same as the user's chosen startup mode if Media Center is not running, or Standard if it is already running.
 
+
|-
'''mc15.exe /Play [''item'']|[''item'']...''' If playback is currently stopped, Playing Now is replaced with the item(s) and playback starts, otherwise the item(s) are appended to Playing Now and playback jumps to the first specified item.
+
| /Play || ''<items>'' || If playback is currently stopped, Playing Now is replaced with the item(s) and playback starts, otherwise the item(s) are appended to Playing Now and playback jumps to the first specified item. Note: The option '''/Play''' may be omitted,  in which case, take care to use double quotes as necessary when issuing commands in the Windows command shell.
 
+
|-
'''mc15.exe /PlayReplace [''item'']|[''item'']...''' Playing Now is replaced with the item(s) and playback starts.
+
| /PlayReplace || ''<items>'' || Playing Now is replaced with the item(s) and playback starts (same as /Replace).
 
+
|-
:Each [''item''] can be one of the following:
+
| /Power || || Media Center is started when it is not currently running, or closed when running.
:* A filename: '''C:\song1.mp3'''
+
|-
:* A URL: '''http:\\www.somewebsite.com\station.pls'''
+
| /Protocol || ||
:* A location within the Organization Tree: '''TREEPATH=Playlists\Playlist1'''
+
|-
:* A device under CD & DVD and Handhelds: '''DEVICE=G:'''
+
| /Replace || ''<items>'' || Playing Now is replaced with the item(s) and playback starts (same as /PlayReplace).
 
+
|-
:Note: The TREEPATH=''Location''\''Item'' specification is case-sensitive for ''Location'' and ''Item'' and the hierarchy separator is \.
+
| /Restart || || Restarts Media Center.
 
+
|-
:Note: For Media Center 10 or greater, the Playback Execute Parameters can be issued to a specific Zone by adding '''Zone=x''' as one of the items in the | delimited list.  e.g. "mc15.exe /Append C:\1.mp3|C:\2.mp3|Zone=3".
+
| /SilentImport || ''<filename>'' || Imports the specified file ''<filename>'' into Media Center library, but does not launch Media Center.
 
+
|-
'''mc15.exe /Power''' Starts Media Center if it's not running, or closes it if it is.
+
| /Start || || Starts Media Center or brings it to top.
 
+
|-
'''mc15.exe /Protocol'''
+
| /Subscribe || ''<podcast URL>'' || Subscribe to the podcast specified by ''<podcast URL>''.
 
+
|}
'''mc15.exe /Replace'''
 
 
 
'''mc15.exe /Restart''' Restarts Media Center.
 
 
 
'''mc15.exe /SilentImport [filename]''' Imports the specified file into Media Center library but does not launch Media Center.
 
 
 
'''mc15.exe /Start''' Starts Media Center or brings it to top.
 
 
 
'''mc15.exe /Subscribe''' subscribe to a podcast.
 
 
 
==Command Parameters==
 
Executing mc15.exe with one of the following command line parameters will only control an already running instance of Media Center. If Media Center is not already running, the following commands are ignored.
 
 
 
'''mc15.exe /Command Play''' Starts playback of the selected track(s).
 
 
 
'''mc15.exe /Command Pause''' Toggles between play and pause states.
 
 
 
'''mc15.exe /Command Stop''' Stops playback.
 
 
 
'''mc15.exe /Command Next''' Skips to the next track.
 
 
 
'''mc15.exe /Command Previous''' Skips to the previous track.
 
 
 
'''mc15.exe /Command FastForward''' Jumps 5 seconds forward.
 
 
 
'''mc15.exe /Command Rewind''' Jumps 5 seconds backward.
 
 
 
'''mc15.exe /Command Mute''' Mutes the sound.
 
 
 
'''mc15.exe /Command VolumeUp [value]''' Increases the sound volume by [value].
 
:Note: [value] defaults to 5%.
 
 
 
'''mc15.exe /Command VolumeDown [value]''' Decreases the sound volume by [value].
 
:Note: [value] defaults to 5%.
 
 
 
'''mc15.exe /Command VolumeSet [value]''' Sets the sound volume directly to [value].
 
:Note: [value] defaults to 50%.
 
 
 
'''mc15.exe /Command ToggleShuffle''' Toggles shuffle mode
 
 
 
'''mc15.exe /Command ToggleContinuous'''  Toggles continuous mode
 

Revision as of 14:53, 28 June 2011

Media Center and Media Jukebox can be controlled by command line parameters sent using a command launcher. The launcher is installed during installation of main application. The command launcher is version-specific, and installed in the standard system directory. The name of the command launcher for Media Center follows the (case-insensitive) form:

MC<MC version>.exe

and for Media Jukebox version 12 and beyond:

MJ<MJ version>.exe

and finally, prior to version 12 of Media Jukebox, the launcher is named:

mjextman.exe

Notes

  • The text that follows in this document will assume the usage of mc16.exe, the launcher for Media Center 16. Use the appropriate command for your version of Media Center or Media Jukebox.
  • The command launcher is installed into the system directory, typically C:\WINDOWS\system32\ (it does not reside in the application directory). Because the system directory is normally included in your system's PATH variable, it is not necessary to specify the full path when invoking the command launcher.

Command Line Options and Parameters

Executing mc16.exe with one of the following command line options / parameters first starts Media Center if it is not already running (exception; see /Command below).

Some options below accept a parameter <items>, which is a list of one or more items, each item separated by a | (vertical bar, or pipe). Through the text, each item in <items> can be any of the following:

  • A filename: Example: C:\song1.mp3
  • A URL: Example: http:\\www.somewebsite.com\station.pls
  • A location within the Organization Tree: Example: TREEPATH=Playlists\Playlist1
The TREEPATH=<location>\<item> specification is case-sensitive for <location> and <item> and the hierarchy separator is \ (backslash).
  • A device under CD & DVD and Handhelds: Example: DEVICE=G:

Each item in <items> may be targetted to a specific Zone by appending the item with Zone=<x>, where <x> is replaced by the Zone number (Media Center 10 or later).

Example: mc16.exe /Append C:\1.mp3|C:\2.mp3|Zone=3


Option Parameter Description
/Append <items> Appends item(s) to Playing Now without changing the current playback state.
/AudioCD
/Clear <mode> Removes all files from Playing Now and stops playback.
Values for <mode> :
  • DontRemoveCurrent Does not remove the currently playing file and does not stop playback.
/Close Closes Media Center.
/Command Note: the /Command option has no effect if Media Center is not already running.
Play Starts playback of the selected track(s).
Pause Toggles between play and pause states.
Stop Stops playback.
Next Skips to the next track.
Previous Skips to the previous track.
FastForward Jumps 5 seconds forward.
Rewind Jumps 5 seconds backward.
Mute Mutes the sound.
VolumeUp <percent> Increases the sound volume by <percent> percent. Default: 5%.
VolumeDown <percent> Decreases the sound volume by <percent> percent. Default: 5%.
VolumeSet <percent> Sets the sound volume directly to <percent> percent. Default: 50%.
ToggleShuffle Toggles shuffle mode
ToggleContinuous Toggles continuous mode
/Connect m01p://<host> Establishes a connection to <host>, a hostname or IP address that specifies the remote Media Server.
/DVDVideo
/ExportToXML <filename> Exports the current library as XML (in the MPL format) to the specified file <filename>. If the program is not running, the command is performed silently, and the program exits.
/Import <filename> Imports the specified file into the Media Center library and launches Media Center.
/ImportAndPlay
/Library <library name> Changes to the library specified by <library name> (Media Center 12.0.384 and later).
/LibraryReadOnly Starts Media Center with the library in read-only mode (aka. Party Mode).
/MCC <command>, <param> Sends the specified Media Center Core Command to Media Center.
<command> is one of the Media Center Core Commands.
<param> is optional, and defaults to 0.
Note: Only available in Media Center.
/MediaServer Starts Media Center in Media Server mode (without a UI).
/Mime
/Mode <modename> Sets the Media Center mode to <modename>. Media Center will be started if it is not running.
Select <modename> from one of the following:
  • Standard, Megame, or Windowed Standard View
  • Minime Mini View
  • Fullscreen Display View
  • Theater Theater View
Note: An empty <modename> is the same as the user's chosen startup mode if Media Center is not running, or Standard if it is already running.
/Play <items> If playback is currently stopped, Playing Now is replaced with the item(s) and playback starts, otherwise the item(s) are appended to Playing Now and playback jumps to the first specified item. Note: The option /Play may be omitted, in which case, take care to use double quotes as necessary when issuing commands in the Windows command shell.
/PlayReplace <items> Playing Now is replaced with the item(s) and playback starts (same as /Replace).
/Power Media Center is started when it is not currently running, or closed when running.
/Protocol
/Replace <items> Playing Now is replaced with the item(s) and playback starts (same as /PlayReplace).
/Restart Restarts Media Center.
/SilentImport <filename> Imports the specified file <filename> into Media Center library, but does not launch Media Center.
/Start Starts Media Center or brings it to top.
/Subscribe <podcast URL> Subscribe to the podcast specified by <podcast URL>.