Announcement

Collapse
No announcement yet.

Batch that closes with the command if exist

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

    no bug Batch that closes with the command if exist


    Hello, there is a bug with IrfanView with windows batch commands

    when you do

    if not exist *.bmp (

    i_view64 SCR2.jpg /resize=(640,350) /convert=SCR2.png

    )

    the batch closes

    #2
    i_view64.exe is probably not in your PATH. Try the full path name.

    Comment


      #3

      Yes, it is in the same folder, also try it, it will crash.

      I believe there is a bug between i_view and with the if exist () command maybe the slashes

      Comment


        #4
        this works:

        if not exist *.bmp i_view64 SCR2.jpg /resize=(640,350) /convert=SCR2.png

        I think this is a windows problem. I have had many funny things happen in windows batch files.

        Matt

        Comment


          #5

          Yes it works without the parentheses but when the parentheses are open it crashes.

          Same for a loop

          for %%f in (*.txt) do ( i_view64 SCR2.jpg /resize=(640,350) /convert=SCR2.png )

          Cordially,
          Last edited by Mitcho; 20.05.2022, 12:12 AM.

          Comment


            #6
            The problem is caused by the brackets in the resize command, put the command in quotes.
            Code:
            if not exist *.bmp (
            
            i_view64 SCR2.jpg "/resize=(640,350)" /convert=SCR2.png
            
            )
            My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

            Comment


              #7
              Wow, I missed that. I saw that removing the resize made it work and still didn't see it.

              Thanks

              Comment

              Working...
              X