View Single Post
Old 02-11-2011, 12:53 AM   #1
nharrison66
Junior Member
nharrison66 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2011
Location: Sydney, Australia
Device: Kindle
exit codes for command line apps

Hi All,

I have been messing around with windows command batch scripts and vbscripts to automate the retrieval of news recipes & having them emailed to my kindle. I think i am close to finalising a working vbscript but i just now need to incorporate some logging & error handling.

Does anyone know (kovid are you out there?) if there is a way to trap exit codes for ebook-convert.exe & calibre-smtp.exe? Specifically when running these apps from within a vbscript. For example. i am running ebook.convert.exe using the following sample vbscript code...

Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")

cmdConvert = "c:\program files\calibre2\ebook-convert.exe" & " c:\program files\calibre2\resources\recipes\the_oz.recipe " & "c:\temp\the_oz.mobi" & "--output-profile kindle"

errReturn = objProcess.Create(cmdConvert, null, null, intProcessID)

I am also monitoring the completion of the processid before moving on to calibre-smtp.exe.

I would like to a) trap any exit code & b) log the .exe process to text file.

Regards
Nick
nharrison66 is offline   Reply With Quote