View Single Post
Old 05-06-2011, 12:32 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,411
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You rather than giving yourself a hernia jumping through microsoft hoops, why dont you just use a decent script language instead of BAT. You can even do it with calibre itself for example:

Create a .py file called myscript.py
Code:
import subprocess, sys

# Command line arguments ar in sys.argv
print 'Command line arguments', sys.argv

subprocess.check_call(['ebook-convert', sys.argv[1], sys.argv[2]])
subprocess.check_call(['ebook-viewer', sys.argv[2]])
Now run this script with

Code:
calibre-debug -e myscript.py input_file.epub output_file.epub
This will run ebook-convert for you and open the result in the viewer.

I'm sure you can figure out the rest.
kovidgoyal is offline   Reply With Quote