View Single Post
Old 10-25-2013, 10:08 PM   #25
Frank44
Junior Member
Frank44 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2011
Device: Nook Simple Touch
Quote:
Originally Posted by PeterT View Post
Sure ..

At command line
Code:
for /r %1 in (*.mobi) do "c:\Program Files (x86)\Calibre2\ebook-convert.exe" "%~dpn1.mobi" "%~dpn1.epub"
In a batch file
Code:
for /r %%1 in (*.mobi) do "c:\Program Files (x86)\Calibre2\ebook-convert.exe" "%%~dpn1.mobi" "%%~dpn1.epub"
In either case it will go through all directories starting at the current directory and convert mobi files to epubs.

The difference in the two command lines is due to the interpretation of the % symbol at the command line, and in a batch (or cmd) file.

The weird stuff %~dpn1 is just extracting the drive, path and file name from the whole file name; ie dropping the extension.
This is how I used PeterT's superb batch file command of 17th Nov 2012:
1. Install Calibre.
2. Copy your mobi files to c:\temp (or subfolders of c:\temp).
3. Copy PeterT's batch command (above) into NotePad, then save it as mobi2epub.bat in c:\windows\system32 (you may have to save mobi2epub.bat elsewhere, then give administrator permission to copy it to the c:\windows\system32 folder).
4. In Windows Explorer, navigate to c:\temp, hold down the shift key then right click, then select "Open command window here" to open the command window in c:\temp.
5. In the command window, type "mobi2epub" without the quotes. Calibre will convert the mobi files to epub.
Frank44 is offline   Reply With Quote