View Single Post
Old 01-21-2009, 10:25 AM   #13
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Okay, so just read up on environment variables since I had no idea what they were. How do I create a DOS/Windows batch file that automatically changes the config path relative to the location of Calibre?

Say I have the following directory structure:
Quote:
PortableCalibre
|- Calibre (copy of install directory)
|- config (location of settings)
|- calibre-db (location of database and books)
|- portablecalibre.bat
Will the following batch file work (portablecalibre.bat):
Code:
@echo off
cd config
setlocal
set CALIBRE_CONFIG_DIRECTORY = %cd%
cd..
cd calibre
calibre.exe --with-library  ..\calibre-db
endlocal
Another question, if Calibre is already installed on the PC, am I correct in assuming the above batch file would only change settings for "portable calibre" and the version installed on the computer would be unaffected by the path change?

Thanks!
ilovejedd is offline   Reply With Quote