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
|