![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,074
Karma: 14079267
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
ebook-convert won't work in a batch file since 0.6.17
I often use ebook-convert in a batch file to convert a number of ebooks in one go. Up to 0.6.16 this worked fine, but from .17 onwards it doesn't anymore.
When I have a batch file consisting of a number of ebook-convert commands, the first command that runs exits the entire batch file when it's done. Running the batch file from within a command shell does the same, and starting the batch file again in the same shell just exits the batch file without even (visibly) starting ebook-convert. This is on WinXP SP3, fully patched. Kovid, any idea what changed between 0.6.16 & .17 to cause this? |
![]() |
![]() |
![]() |
#2 | |
Zealot
![]() ![]() Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
|
Quote:
The latest 0.6.20 installer does have an option to add the location of the installation folder to the PATH of Windows. To test this theory: - open a CMD prompt - just type: ebook-convert.exe ( this should give you the help text of the program) - if not then: -- goto the installation folder of Calibre -- then type: ebook-convert.exe (now you should get the help) If I'm not clear then let us know and I'll retry in a different wording, or someone else. Regards, Joop |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,074
Karma: 14079267
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
Quote:
So that's not it. |
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
You could always try amending your batch file so that each time the ebook-convert program is run it is under a new shell to see if that solves the issue?
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,074
Karma: 14079267
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
It doesn't; just tried it. I even tried two levels deep, having 'cmd /c ebook-convert' in the batch file and running the batch file with "cmd /c" itself. No dice; it still does the same.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,144
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Odd I have no idea what could be causing that. Does ebook-convert exit cleanly after an invocation? WHat's it's exit code.
|
![]() |
![]() |
![]() |
#7 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,074
Karma: 14079267
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
Quote:
I don't know what the exit code is; I'll try to find out when I'm home this evening. |
|
![]() |
![]() |
![]() |
#8 | |
Zealot
![]() ![]() Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
|
Quote:
Running, it looks like, any calibre executable inside a batchfile wrecks havoc on all commands following it. For example the following demonstrates this. - open a command prompt where you have test.bat download - run test.bat from the command prompt, calibredb should be in your PATH - notice that the 'pause' is never executed! - even stranger, restart the test.bat without closing the command prompt - notice what happens or the lack thereof ![]() Regards, Joop Last edited by JvdW; 11-02-2009 at 08:15 AM. Reason: typos |
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,144
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
OK opena ticket, I'll take a look the next time I run my windows VM
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,074
Karma: 14079267
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,074
Karma: 14079267
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
Joop, Kovid gave me the hint to try PowerShell instead of CMD. Just running the batch file under PS didn't work any better than under CMD, but what *did* work was feeding the batchfile as standard input to PS, like this:
PowerShell -command - < batchfile.bat Don't ask me why that works, but it does. Perhaps Kovid will figure it out :-). The same trick doesn't work for CMD, though. |
![]() |
![]() |
![]() |
#12 |
Zealot
![]() ![]() Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
|
![]()
Hello All,
Sorry to resurrect an old problem but I think its solved in versions of Calibre greater or equal to 0.7 Regards, Joop |
![]() |
![]() |
![]() |
#13 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 1033566
Join Date: Mar 2010
Location: Latvia
Device: Kindle 3 Wifi, Bookeen Opus
|
For me it still doesn't work but for another reason. Windows XP command line batch processing stops after setting the code page to unicode (chcp 65001). No idea why it is so but it looks that it is a documented feature.
For this reason is there any other way to pass parameters for ebook-convert.exe except for command line? I am experimenting with the conversion from html to epub I need to run a batch file often. I need to use unicode for metadata and it is inconvenient to include all this information in the command line. |
![]() |
![]() |
![]() |
#14 | |
Zealot
![]() ![]() Posts: 115
Karma: 150
Join Date: Jul 2008
Location: Netherlands Veenendaal
Device: Palm T5, Sony PRS-505, Nook Color
|
Quote:
This is what I came up with to circumvent the problem on XP. Its not elegant and it might not work for you depending on what you want accomplished. The following is part of a script which I use to download the latest NRC epub Code:
REM Add News as tag, and date as comment start /wait ebook-meta -c %TODAY% --tags=News %TEMP%\nrc-%TODAY%.epub REM Add to Calibre database start /wait calibredb add %TEMP%\nrc-%TODAY%.epub REM Find database ID by looking for comment REM for /f "tokens=1,2" %%a in ('calibredb list -s comments:%TODAY%') do if %%b==NRC set id=%%a start /wait c1.bat for /f %%a in ('type %TEMP%\test.env') do set id=%%a REM Mark ePaper to be auto-uploaded to reader start /wait calibre-debug -c "from calibre.gui2 import dynamic; ids = dynamic.get('news_to_be_synced', set([])); ids.add(%id%); dynamic.set('news_to_be_synced', ids)" Hope this helps you with your problem Regards, Joop |
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,581
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Thanks, I had the same problem yesterday when I updated calibre in my Windows XP. I'll give a try.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ebook-convert don't work in ubuntu 9.10 | vakya | Calibre | 2 | 10-26-2009 04:36 PM |
Batch convert error | Dopedangel | Calibre | 2 | 09-07-2009 03:46 AM |
Word Documents - batch convert title property from file name | tomliversidge | Workshop | 4 | 11-07-2008 11:20 AM |
Batch-convert Rocket Ebook format for GEB2150? | Fauve | Fictionwise eBookwise | 1 | 04-28-2007 05:12 PM |
Batch convert to plucker .pdb file. | khaoohs | Workshop | 2 | 04-28-2006 11:23 PM |