MediaPortal: Mounting network shares from MediaPortal and on logon

<

p>I have stored my media files on a server. These files can be accessed by mounting smb shares as volumes. As posted on the display setup page I used a single logon script called logon.cmd to do all the tasks which are needed when starting the HTPC. As you can see I mounted the two network volumes z: and y: within this script. This is not very useful when the server is offline while the HTPC is starting. The offline server could also result in some delay when logging in while trying to mount the volumes from an unreachable host.

<

p>

Now when MediaPortal has been started the volumes were not accessible. So I had to switch to Windows by hand and mount the volumes by hand. This is not very comfortable. So I decided to change the setup a little.

Idea

The biggest benefit would be to make the later mount from MediaPortal possible. This can be done easily by extracting the mount things to a separate script e.g. mount.cmd and then using the MediaPortal MultiShortCut plugin to make it executable from the MediaPortal GUI. Additionally the new mount.cmd needs to be added as new call to the logon.cmd.

So let’s do it…

New scripts

This is my final mount.cmd:

@echo off
net use /d /y z:
net use z: \\<give-hostaddress-here>\<give-share-here> <give-password-here> /USER:<give-user-here> /PERSISTENT:NO

And this is my modified logon.cmd:

@echo off
 
echo Mounting shares...
cmd /c c:\scripts\mount.cmd
 
echo Loading ATI-Profile and Start Media Portal...
echo main_start > c:\scripts\screen_main.txt
 
cmd /c c:\scripts\switch.cmd

For your information: the logon.cmd needs to be executed on every logon like described on the display setup page.

MediaPortal MultiShortcut setup

To be able to call the mount.cmd from MediaPortal I use the MediaPortal MultiShortcut plugin. Simply download the plugin from here.

mediaportal-multishortcut-mount-1

Then simply extract the files DLLFix.exe and MultiShortcut00.dll to your MediaPortal\plugins\Windows directory. In my case it is C:\Programme\Team MediaPortal\MediaPortal\plugins\Windows.

Now you need to rename the dll file to something you like. I named it MS_Mount.dll. After that you need to set a uniq plugin ID for that dll – simply call the DLLFix.exe for that.

mediaportal-multishortcut-mount-2

Then enter the MediaPortal configuration, browse to the plugin configuration and enable the MS_Mount plugin. Click on config to configure the plugin as shown in the screenshot on the left.

mediaportal-mount-result Finally close the MediaPortal configuration and start MediaPortal. If you done right you will find a new entry in your navigation called “Mount volumes”. Now you can remount your network volumes directly from MediaPortal by hitting this button.

Bonus

<

p>If you like to mount your volumes from any MediaPortal view you can assign a keyboard shortcut with the ShortCuter plugin to the “Mount volumes” call and assign this with your HTPC remote. An example for this procedure using the DH-102 case with iMon ca be found in the lower parts of the display setup page.

<

p>

Comments (0) Trackbacks (0)

No comments yet.

No trackbacks yet.