Google Search

Wednesday, 2 December 2009

How to launch a command file from within MCE

I saw a user on the Green Button asking this question the other day and as I had a method of doing this I thought I’d write a post about it.

There may well be different ways to accomplish the same thing, but this is what works for me and the way I get an icon into the Extra’s area of 7MC and when I click on it, it runs a command line in the background. (This also works on Vista)

First you need to download this little add-in here, then extract / save it to the C:\Windows\ehome directory.

This is a single .dll file that was written for me by Andrew Cherry so credit goes to him.

Next you need to create an XML file.

Below is an example of one of my XML files, that when registered in to Media Center, allows me to click on an icon in Media Center and have a VPN connection command run in the background.

You need to change the items in red to suit your needs, my paths for this point to C:\program files, you can probably change the path to what ever you like and point it to the location of your .cmd file.

The icon images I use are 122 x 122 .png files.

Once you have finished editing your XML file give it an appropriate name and save it in to the C:\windows\ehome directory ensuring it has a .XML extension and not .txt.

Note: If you want to register more than one icon into Media Center by creating a second XML file, you will need to ensure you change the GUID ID’s on the id= and entrypoint id= lines. I normally just change the last two numbers to something else, for example:

Now you need to register your XML file in to Media Center, open a command prompt (Run as Administrator), make sure you are in the C:\Windows\ehome directory then type registermceapp /allusers name of your.xml

Where name of your.xml is the filename you gave your xml file that you saved in the ehome directory earlier. Hit enter and you should see Success

Open Media Center go to the Extra’s library and your new icon should now be visible, click the icon and test that your command file is run?

To remove the icon you can use the command registermceapp /allusers /u name of your.xml

Well I think that’s everything, hopefully it will work for you as well.

2 comments:

I discovered this app and is very useful. Could be possible to ask something to Andrew Cherry? I would like to ask if it's possible to retrieve parameters when running it inside a gallery (with a specific file selected) using for example the mode