View Single Post
Old 03-26-2010, 08:15 AM   #17
bthoven
Evangelist
bthoven will become famous soon enoughbthoven will become famous soon enoughbthoven will become famous soon enoughbthoven will become famous soon enoughbthoven will become famous soon enoughbthoven will become famous soon enough
 
bthoven's Avatar
 
Posts: 475
Karma: 590
Join Date: Aug 2009
Location: Bangkok, Thailand
Device: Kindle Paperwhite
Quote:
Originally Posted by chaley View Post
Hmmm....

On windows 7, I created a batch file containing
Code:
web2disk http://uncle-rods.blogspot.com  -r 0
ebook-convert index.xhtml unclerod.epub --authors "Rod Mollise" --author-sort "Mollise, Rod" --cover "http://skywatch.brainiac.com/astroland/rodnow.jpg"
Running that batch file from a command box, I get
Code:
C:\Users\charles\Desktop\foo>run.bat

C:\Users\charles\Desktop\foo>web2disk http://uncle-rods.blogspot.com  -r 0
.

C:\Users\charles\Desktop\foo>ebook-convert index.xhtml unclerod.epub --authors "Rod Mollise" --author-sort "Mollise, Rod" --cover
"http://skywatch.brainiac.com/astroland/rodnow.jpg"
Downloading cover from u'http://skywatch.brainiac.com/astroland/rodnow.jpg'
1% Converting input to HTML...
InputFormatPlugin: HTML Input running
on C:\Users\charles\Desktop\foo\index.xhtml
Language not specified
Creator not specified
Building file list...
IgnoreFile(u'Could not read from file: c:\\"http:\\uncle-rods.blogspot.com\\" with error: (22, "invalid mode (\'rb\') or filename"
)',)
Initial parse failed:
Parsing file 'index.xhtml' as HTML
Forcing index.xhtml into XHTML namespace
Stripping comments and meta tags from index.xhtml
Merging multiple <head> and <body> sections
[lots of random warnings deleted]
Creating EPUB Output...
67% Creating EPUB Output
        Looking for large trees in index.xhtml...
        No large trees found
        Split into 6 parts
EPUB output written to C:\Users\charles\Desktop\foo\unclerod.epub
Output saved to   C:\Users\charles\Desktop\foo\unclerod.epub
C:\Users\charles\Desktop\foo>
As it works for me, you must be having some environment-specific problem. Some questions:

1. What version of windows are you running? (Windows XP SP3)
2. If run the commands one at a time in a foreground command box, does it work? (Yes)
3. If the answer to #2 is yes, does running your batch file in the same foreground command box (not with the task scheduler) work? Be sure that your working directory is the same as in #2.
(Yes, I run both commands in foreground. If I split each command into separate batch files, and run each batch file one at a time in sequence, it works)

My suspicion is that the problem comes from the current directory being something other than what you expect, especially if you are using a shortcut to the batch file or if the batch file lives in a normally-readonly folder. One thing you can try is to add as the first line of the batch file a cd to the folder where the output files are expected to end up.
Please see my answers inserted in your original quote.
bthoven is offline   Reply With Quote