Welcome to FreeSoftwareServers Confluence Wiki

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\Kodi\"Kodi Installation"

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

        <default pathversion="1"></default>
        <default pathversion="1"></default>
            <path pathversion="1">X:\Movies\</path>
            <path pathversion="1">X:\TV\</path>
        <default pathversion="1"></default>
            <path pathversion="1">X:\Music\</path>
        <default pathversion="1"></default>
            <path pathversion="1">X:\Pictures\</path>
        <default pathversion="1"></default>

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:


Windows Registry Editor Version 5.00


  • No labels