The Command Line: Difference between revisions
m (Added table caption) |
(Added /MonitorSwitch, /MonitorExtend, and /SoundcardSwitch) |
||
Line 114: | Line 114: | ||
: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. |
||
|- |
|||
| /MonitorExtend || || Extend available displays across all monitors (Windows 7). |
|||
|- |
|||
| /MonitorSwitch || ''<monspecs>'' || Select, enable and disable monitors and resolution for playback. Use /MonitorSwitch without arguments for usage information. The format of ''<monspecs>'' is one or more of: |
|||
''<device>''''':'''enable<br /> |
|||
''<device>''''':'''disable<br /> |
|||
''<device>''''':'''''<width>'''''x'''''<height>'''''x'''<''bit depth>'''''x'''''<refresh>''['''xprimary'''] |
|||
|- |
|- |
||
| /Play || ''<playitems>'' || 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. |
| /Play || ''<playitems>'' || 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. |
||
Line 128: | Line 136: | ||
|- |
|- |
||
| /SilentImport || ''<paths>'' || Imports (silently) the specified files/folders into the Media Center library, but does not launch Media Center. |
| /SilentImport || ''<paths>'' || Imports (silently) the specified files/folders into the Media Center library, but does not launch Media Center. |
||
|- |
|||
| /SoundcardSwitch || ''<cardspec>'' || Select sound card for playback (Windows 7/Vista). Use /SoundcardSwitch without arguments for usage information. The format of ''<cardspec>'' is: |
|||
DefaultByIndex:''<sound card index>''<br /> |
|||
|- |
|- |
||
| /Start || || Starts Media Center or brings it to top. |
| /Start || || Starts Media Center or brings it to top. |
Revision as of 21:47, 30 August 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 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:
- mc16.exe /Append C:\1.mp3|C:\2.mp3|Zone=3
Option | Parameter | Description |
---|---|---|
/Append | <playitems> | Appends item(s) to Playing Now without changing the current playback state. |
/AudioCD | <drive> | Plays the audio CD specified in drive <drive> (e.g.. D:). |
/Bluray | <drive> | Plays a Blu-ray disc specified in drive <drive> (e.g.. F:). Currently functionally equivalent to the /DVDInfo option. |
/Clear | <mode> | Removes all files from Playing Now and stops 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 | <drive> | Plays a DVD specified in drive <drive> (e.g.. E:). Currently functionally equivalent to the /Bluray option. |
/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 | <paths> | Imports the specified files/folders into the Media Center library and launches Media Center. |
/ImportAndPlay | <paths> | Same command as /Import, but also starts playback of the imported files (this replaces Playing Now).. |
/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.
|
/MediaServer | Starts Media Center in Media Server mode (without a UI). | |
/Mime | Used by some Stores. | |
/Mode | <modename> | Sets the Media Center mode to <modename>. Media Center will be started if it is not running.
|
/MonitorExtend | Extend available displays across all monitors (Windows 7). | |
/MonitorSwitch | <monspecs> | Select, enable and disable monitors and resolution for playback. Use /MonitorSwitch without arguments for usage information. The format of <monspecs> is one or more of:
<device>:enable |
/Play | <playitems> | 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 | <playitems> | 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 | <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. mc16://ShowHelp/Import). |
/Replace | <playitems> | Playing Now is replaced with the item(s) and playback starts (same as /PlayReplace). |
/Restart | Restarts Media Center. | |
/SilentImport | <paths> | Imports (silently) the specified files/folders into the Media Center library, but does not launch Media Center. |
/SoundcardSwitch | <cardspec> | Select sound card for playback (Windows 7/Vista). Use /SoundcardSwitch without arguments for usage information. The format of <cardspec> is:
DefaultByIndex:<sound card index> |
/Start | Starts Media Center or brings it to top. | |
/Subscribe | <podcast URL> | Subscribe to the podcast specified by <podcast URL>. |
Examples
- Play file.flac.
- mc16.exe /play "C:\path\to\file.flac"
- Import file.mp3 and start playback.
- mc16.exe /importandplay "C:\path\to\file.mp3"
- Silently import the files contained in folder1 and folder2.
- mc16.exe /silentimport "C:\path\to\folder1|M:\path\to\folder2"