On Mon, Jun 26, 2006 at 10:07:33AM +0000, SteveTucknott wrote:
> Good morrow all,
>  
> I need to be able to get the status of  a 'convert' command - I am taking 
> pages from a multi-page tiff and converting each page to png. The program 
> calling this process needs to know when the last page is reached, so I 
> assumed that if I can get the status back to my code, that would tell me.
> At the moment I'm running a command such as:
> cmd /c convert tiff-file[page] png-file
>  
> and I seem to be getting back the status from cmd rather than from convert.
>  
> I have also tried creating a batch file (masterbat.bat):
>  
> cmd /c mybat.bat
> ECHO "MyBAT GAVE "%ERRORLEVEL%
> notepad  c:\tmp\masterbat.bat
>  
> mybat.bat:
> convert -compress NONE -resize x634 C:\tmp\fred[10] c:\\tmp\\image_bat.png
> ECHO "CONVERT GOT ("%ERRORLEVEL%")"
>  
> Just to see what I get back - and it seems that ERRORLEVEL is set to 0 
> irrespective of whether the input file/page exists or not.
>  
> Any ideas as to how I get at the status of the convert command?

You can do something like

c.bat:

convert ...
exit %ERRORLEVEL%


and in the calling .bat:

cmd /c c.bat
echo %ERRORLEVEL%


--
Chris Christoph P. U. Kukulies kuku_at_kukulies.org
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to