The Command Line

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 mc20.exe, the launcher for Media Center 20. 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 mc21.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 in the table below accept a parameter <paths>, which is a list of one or more paths to files and/or folders, each item separated by a | (vertical bar, or pipe).

Some options in the table below accept a parameter <playitems>, which is a list of one or more items, each item separated by a | (vertical bar, or pipe). Through the text, each item in <playitems> 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 <playitems> may be targeted 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:

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

Media Center Command Line Options and Parameters

Option

Parameter

Description

/Append

<playitems>

Appends item(s) to Playing Now without changing the current playback state.

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. If <playitems> is empty, starts playback of the selected track(s), but see Note 1.

/PlayReplace

<playitems>

Playing Now is replaced with the item(s) and playback starts (same as /Replace).

/PlayNext

<playitems>

Playing Now has the files added as the next to play.

/Power

Media Center is started when it is not currently running, or closed when running.

/Previous

Skips back to the previous track. See Note 1.

/PreviousAlbum

Skips back to the first listed track of the previous album. See Note 1.

/PreviousArtist

Skips back to the previous artist (the topmost track of a sequential group by the previous artist). See Note 1.

/Protocol

<command>

Executes the specified protocol command <command>, where the web browser subsequently runs <command>. This option is used primarily for embedding commands into webpages (e.g. mc19://ShowHelp/Import).

/Replace

<playitems>

Playing Now is replaced with the item(s) and playback starts (same as /PlayReplace).

/Restart

Restarts Media Center.

/Rewind

Jumps 5 seconds backward. See Note 1.

/ShowTreePath

<treepath>

Starts Media Center if necessary, and changes the tree selection to the specified <treepath>.

/SilentImport

<paths>

Imports (silently) the specified files/folders into the Media Center library, but does not launch Media Center.

/Sleep

<milliseconds>

Sleeps the specified number of <milliseconds> and then exits; supports delays in scripting.

/SoundcardSwitch

<cardspec>

Select sound card for playback (Windows 7/Vista). Use /SoundcardSwitch without arguments for usage information. The format of <cardspec> is: