Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

The "issue" with Kodi even in portable mode is if you plan to move a USB to other computers, the drive letter may change and paths break. I found a good solution on this thread.

The code is quite an elegant solution IMO.

Note: I also use VLC in Portable Mode w/ Advanced Settings.xml, but that isn't necessary.

@Echo off

:: Map X to "Current Directory"
subst X: /D
subst X: "%cd%"
 
::Hide X Drive from Windows Explorer:
regedit /s X:\Kodi\hide_x_drive.reg

::Start Kodi:
start /B x:\Kodi\Kodi.exe -p

I have a folder structure like so:

%wherever%\Media\
%wherever%\Media\kodi_portable.exe
%wherever%\Media\Kodi\"Kodi Installation"
%wherever%\Media\TV\*
%wherever%\Media\Movies\*
%wherever%\Media\Music\*

The one "cool" thing I liked from the thread was turning the batch file into an exe. This allowed me to give it the Kodi Icon and make it more "normal" for the end user. (Used to running exe not .cmd)

So I used http://www.bat2exe.net/ to convert the batch file into an executable. Also search the Kodi folder for *.ico, mine was called "facicon.ico" and put that into the same folder as the batch file to inject icon into file executable.

Update, seems Anti-Virus thinks this is fishy and deleted the file, so I'm back to using a regular.cmd

If you use the above folder structure, you can add sources via GUI or use the following sources.xml

<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Movies</name>
            <path pathversion="1">X:\Movies\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>TV</name>
            <path pathversion="1">X:\TV\</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>Music</name>
            <path pathversion="1">X:\Music\</path>
            <allowsharing>true</allowsharing>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
        <source>
            <name>Pictures</name>
            <path pathversion="1">X:\Pictures\</path>
            <allowsharing>true</allowsharing>
        </source>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>

I also added a registry to hide the "X" drive from Windows Explorer as I found the batch file didn't work correctly when run from the X drive:

hide_x_drive.reg

Windows Registry Editor Version 5.00



[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDrives"=dword:08388608


  • No labels