Announcement

Collapse
No announcement yet.

How to capture error messages from command line

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to capture error messages from command line

    Hello,

    When starting irfanview from the command line, how do you capture error messages? For example, let's say I try to open a BMP image file:
    i_view32.exe images\swirl.bmp

    Attempting to load this image results in the following pop up error from irfanview:
    "swirl.bmp: Decode error! Invalid or unsupported BMP file."

    However, irfanview keeps running (no exit error code) and I don't see any error indications from the command line. Is there a way to capture this error from the command line or programmatically via an API?

    Please advise,
    --Jim

    #2
    Exit-Codes

    From i_options.txt: "IrfanView exit code is 0. If /convert or /print is used, there is 1 or 2 also possible, for load/save error."
    No other exit codes (error codes) are documented.
    Win 10/64 Home 22H2 IrfanView 4.66/64
    Hate has caused a lot of problems in this world, but it has not solved one yet. (Maya Angelou)

    Comment


      #3
      Thank you for the reply. However, that still does not answer my question - when loading an image from the command line where irfanview encounters an error loading the image, is it possible to capture the error message from the command line or via an API?

      Comment


        #4
        If you use Windows command window, you have two options to capture what you see in that window:
        1) you can make a screenshot (this is a Windows feature, please ask if you don't know how) or use Irfanview for a screenshot.
        2) you can mark the text with the mouse, copy the marked text with [CTRL]+[C], and paste the text to an editor or office application to
        save it there.

        Hope this is the help you're looking for.
        Win 10/64 Home 22H2 IrfanView 4.66/64
        Hate has caused a lot of problems in this world, but it has not solved one yet. (Maya Angelou)

        Comment


          #5
          Hello Kuki,

          Thank you again for the reply. I was hoping for a programmatic solution. Let's say I'm trying to load 1 million images. It would be nice to know which ones failed to load because of some kind of error (for example, an invalid image file). While taking a print screen or manually copying the error text certainly works for hand viewing a few images, I'm sure you'd agree that this would be undesirable to do for viewing a million different image files.

          Also, please let me know if this is the wrong forum to ask this kind of question. Is there one that's better suited for programmatic type questions?

          Best regards,
          --Jim

          Comment


            #6
            Hi Jim,
            I've never used Irfanview command line options. But I've I taught myself how to use MS-DOS. So I know some tricks.
            Don't know is this works with Irfanview, but you can try to add "> faults.txt" (without "") to paste all Irfanview output to a text file.
            You won't see any output in the command window then. Irfanview is ready when you see the prompt appears again.
            Win 10/64 Home 22H2 IrfanView 4.66/64
            Hate has caused a lot of problems in this world, but it has not solved one yet. (Maya Angelou)

            Comment

            Working...
            X