[Windows] Relative paths in portable mode - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Discussions (https://forum.kodi.tv/forumdisplay.php?fid=222) +--- Forum: Feature Requests (https://forum.kodi.tv/forumdisplay.php?fid=9) +--- Thread: [Windows] Relative paths in portable mode (/showthread.php?tid=94181) |
[Windows] Relative paths in portable mode - JoaoVr - 2011-02-14 Hi there, xbmc portable mode is a bit "dumb" if we are using it on different computers, it only works if the driver letter is always the same, so, whats the point? It would be nice if xbmc portable mode got a way to use relative paths by default or a script maybe. I use xbmc on my computer, it`s installed in my external HDD, if I want to take my stuff (xbmc + media) to a friend, if the drive letter is different from mine I have to manually change it. A nice feature(script maybe) would be to xbmc detect an "media" folder inside the installation/xbmc folder regardless the driver letter for the HDD. Thanks Sorry for my bad english - AnalogKid - 2011-02-14 XBMC works perfectly in portable mode on any drive for me. What aspect of 'portable' isn't working for you? Please make sure you're running xbmc.exe -p (-p = portable mode) The entire function of XBMC will then work on ANY drive and can be moved from drive to drive without any problem, all your user data / config is stored under the XBMC folder making the installation 100% portable. If you are talking about it being unable to find the 'media' - because the media has changed drive letter, then you're correct, it will not find the media. You can fix this in a number of ways: 1) Make sure your media resides on a drive letter that's always available. Or use the 'Subst' command to map a drive letter to your media (e.g. Subst Z: F:\My Media) 2) Use symbolic links as I do (if you're using Vista or later). Here is my portable XBMC script which you can use (XBMCPORTABLE.BAT): Code: @Echo off Here's how I structure my installation: D:\XBMC\ D:\XBMC\XBMCPRTABLE.BAT <--- the launcher! D:\XBMC\Virtual Media Folders\ D:\XBMC\Virtual Media Folders\Movies 01 <------ VIRTUAL folders D:\XBMC\Virtual Media Folders\TV Series 01 D:\XBMC\Virtual Media Folders\etc D:\XBMC\XBMC <----- the REAL XBMC folder Here's what the batch file does: 1) It ALWAYS makes sure XBMC is running from drive 'X' regardless of there it's physically located. This is done by mapping Drive X to the XBMC installation. 2) It then creates a folder called 'Virtual Media Folders', and within that folder creates VIRTUAL folders (via symbolic links) to my real media folders. *** Critical note: you MUST setup XBMC sources to point to these folders (i.e. ALWAYS X:\Virtual Media Folders\xxxxxx) 3) It then launches XBMC in portable mode. So why is this cool? It's cool because you can move ANY of your real media folders to any disk drive you like, and all you have to do is update your VIRTUAL folders to point to the new location. XBMC is 'fooled' because it always finds media via the X:\virtual media folders\xxxxx mapping. This way XBMC AND the media become truly portable. If you don't understand any of the above, just let me know and I'll try to make it clearer. Good luck! - JoaoVr - 2011-02-14 Many Many Thanks I thing It's working perfectly My "XBMC Start Here.bat" Code: @Echo off If I only use the folders inside the XBMC can I only use this:? Code: @Echo off - AnalogKid - 2011-02-15 If you are certain you will never want to move your media around (and always keep it with xbmc, then a single 'Subst' will work, yes :-) The golden rule is to make sure XBMC scans the media using your subst drive (this way it's in the database as 'X:\'). I just prefer the symbolic link (mklink) method because it's ultimately more flexible. Great that it's working for you :-) - JoaoVr - 2011-02-18 AnalogKid Wrote:If you are certain you will never want to move your media around (and always keep it with xbmc, then a single 'Subst' will work, yes :-) Working great! Thanks! - wakowrz - 2012-01-09 i think this is one of the best methods to use xmbc in a portable way. i just used this bat: Code: @Echo off ***look at the subst X: "%cd%" is for compatibility with the exe compiler xD and then compiled to exe with a freeware (bat to exe) now i put my usb in anycomputer (windows vista or seven) and run that exe. RE: - jlc01 - 2012-05-20 (2011-02-14, 15:26)AnalogKid Wrote: XBMC works perfectly in portable mode on any drive for me. Sorry I am having trouble getting folder inside the x:/Virtual Media Folders (Movies 01 Movies 02 etc) to create so cannot add them to sources in xbmc. If my starting drive letter in J is there anything in the code i need to change? Could you please go through it in more detail RE: [Windows] Relative paths in portable mode - AnalogKid - 2012-05-20 OK, the first thing it does it create a 'X' drive. The 'X' drive is the drive that XBMC will be mapped onto. You can make this any drive you like, but X is the one that I use. The second thing is does is create a folder called 'Virtual Media Folders' (in the X Drive) This is erased and regenerated every time the .Bat file is run. The third thing it does is create symbolic links inside the 'Virtual Media Folders' folder. This is the crucial 'trick'. Each symbolic link acts as a 'fake' folder than points to a 'real' folder where your media really resides. When you configure XBMC, you should only ever use the 'Virtual Media Folders' (and subfolders) as your source (all on the X drive) - by doing this, you can then change your 'real' media folders whenever you like, and XBMC will still work :-) If you are having trouble with the MKLINK command, you probably need to run the batch file as an administrator. Let me know if that works for you. RE: [Windows] Relative paths in portable mode - jlc01 - 2012-05-21 Hi AK, Thanks for getting back to me so quickly, I think you might be on the right track with running as admin, but I am a bit unsure how to run a batch as admin. Even so there is no warning to say 'you cant create link without admin' which other people seem to be getting. What your saying makes perfect sense, and my batch does create X drive, and run XBMC from it. My only issue is none of my mapped mklink folders show up inside the Virtual Media Folders on the X Drive. My Code is Code: @Echo off Everything is on D Drive on my current computer to begin with ie D:\TV and Movies D:\Weather D:\XBMC D:\XBMC\XBMCPORTABLE.bat D:\XBMC\XBMC When I run the BAT, X drive is created and this is what appears on it X:\Virtual Media Folders ("TV and Movies" and "Weather" Folders don't show up here) X:\XBMC X:\XBMC\XBMCPORTABLE.bat X:\XBMC\XBMC There is also a Virtual Media Folders created on the D Drive D:\XBMC\Virtual Media Folders, should this be happening? Any ideas? RE: [Windows] Relative paths in portable mode - ZeroQI - 2013-02-22 Hello All. After few trials, managed to use relative path [\Anime\Jap Sub En\0-9], but the scrapper wouldn't well scrap... I did use then special://xbmc/../../Anime/Jap Sub En/0-9 with XBMC being in a _\Xbmc folder, and it is scraping using anidb. If you go in portable data\userdata\sources.xml, you can add the sources manually not to type every one, and if you have splited into 0-9 and A to Z like me you will have something like: Code: <sources> EDIT: Relative path using "special://xbmc/../" works even with scraping but if you got 4TB of anime, will get you banned when reaching letter "S". I used the anidb mod 1.1.0 and put the delay in the plugin to 200 before starting, didn't help too much. Unless somebody has a tip, will have to split it into A-M and N-Z. Apparently running a "Ping -t" on the anidb ip could help letting udp port longer on some providers however i believe the anidb mod uses http... Will try back using "../../" type of relative path, but scraping metadata info didn't work on my last attempt, but was just discovering scraping... RE: [Windows] Relative paths in portable mode - budswell - 2013-11-08 Thanks. The special://xbmc/../ works great for me RE: [Windows] Relative paths in portable mode - Danny3 - 2015-04-18 So Kodi doesn't use relative paths in portable mode? Is portable only with hacks? RE: [Windows] Relative paths in portable mode - FreeSoftwareServers - 2018-11-20 I used answer 6 but added hiding the X drive that shows in Windows Explorer: @echo off Rem ****** Map X: to this folder ********* 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 hide_x_drive.reg: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoDrives"=dword:08388608 |