Announcement

Collapse
No announcement yet.

Script doesn't wait

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

    Script doesn't wait

    Hello,
    I have this script:
    Code:
    call %~dp0\IrfanViewPortable\IrfanViewPortable.exe %~dp0\pictures\*.jpg /convert="%~dp0\Output\temp\%INPUT% %HASH%.jpg"
    call %~dp0\7Zip\7z.exe a %~dp0\Output\%INPUT%.zip %~dp0\Output\temp\*
    @RD /S /Q "%~dp0\Output\temp"
    I want to rename all pictures in the folder "pictures" and copy them to "temp". After renaming 7zip should zip the renamed files. But 7zip starts zipping before irfanview ended the renaming. So just a few pictures get zipped.

    I also tried "start \wait" -> no difference.
    I added "ping 127.0.0.1 -n 2 > nul" with various times -> a few more pictures get zipped but not all

    How does the Batch wait until irfanview is ready with coping all pictures?

    Julian

    #2
    How about using a Pause cmd and pressing any key to continue with the archiving operation?
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      Possible

      Originally posted by Bhikkhu Pesala View Post
      How about using a Pause cmd and pressing any key to continue with the archiving operation?
      That would be a possibility. But I prefer a solution which works without human interaction. The target group of this project needs a tool which is as easy as possible.

      Comment


        #4
        I tried the same program again (without Pause) and its working great... The zipping waits until irfanview finished the conversion. I'll see, if the problem occurs again.

        Comment


          #5
          Are you sure you did exactly the same thing when you tried it the second time? We have discussed this in the past but I am unable to find the thread I was looking for because it was a long time ago.

          The issue is about whether or not the script waits for Irfanview to close before continuing. There are differences between using the command "Start" the command "Call" or no command at all at the beginning of the line where you want to launch an external program. I seem to recall that with no command the script always waits for the external program to terminate, whereas with "Start" it always continues without waiting. With "Call" I think it behaves differently in a Command Prompt window to how it does in a Batch file. I may have got this a bit mixed up though. I have not used Command Prompt scripts for some time, preferring to use Visual Basic scripts instead.

          Comment


            #6
            I have had this problem with Windows 10. The solution was that start will not wait unless you are launching a 64 bit program. Try the 64 bit version of Irfanview.

            Comment

            Working...
            X