Jump to content


PAR2 Batch Verify


  • Please log in to reply
2 replies to this topic

#1 TomMe

TomMe
  • Guests

Posted 14 April 2012 - 09:36 PM

Hi,

I would like to be able to use QuickPar to recursively verify a large amount of files after copying them to another HDD. I've tried to adjust the code found in this thread so that the QuickPar windows do not close after verification, but without success. Either the script doesn't get past the first PAR2 file, or every PAR2 file is being checked simultaneously. This is what I did:
FileSelectFolder, OutputVar, , 3  ;This allows you to select what folder you will do a recursive search in later.
if OutputVar =   ;if cancelled it exits the script
   ExitApp
else
{
   Loop, %OutputVar%\*.par2, , 1   ;this is the loop that finds all the *.par2 files
   {
      IfNotInString, A_LoopFileFullPath, .vol   ;par files have vol files this excludes running any of the volume files
      {
         Run, %A_LoopFileFullPath% ;this runs the par2 fils from before
         loop
         {
            IfWinNotExist, QuickPar - Verifying
            {
               break
            }
         }
      }
   }
msgbox Completed recursive scan for all par2 files
}
return

Can someone please explain to me why this isn't working properly and what I can do to rectify this? Thanks!

#2 Morpheus

Morpheus
  • Members
  • 395 posts

Posted 14 April 2012 - 10:28 PM

This has the potential to become an endless loop if the window does exists.
loop
{
  IfWinNotExist, QuickPar - Verifying
  {
     break
   }
 }

This would be better, but you might have to adjust the numbers to suit your purpose.
loop, 20
{
  IfWinNotExist, QuickPar - Verifying
  {
     break
   }
  sleep, 50
 }

I didn't look at the original script, so I don't know what you are trying to do, but I hope this helps.

#3 Guests

  • Guests

Posted 16 April 2012 - 09:48 AM

This would be better, but you might have to adjust the numbers to suit your purpose.

loop, 20
{
  IfWinNotExist, QuickPar - Verifying
  {
     break
   }
  sleep, 50
 }

Thanks for your assistance, but that would defeat the purpose as the script needs to hold until verification of the current window is complete, which will always happen at some point. Otherwise a lot of PAR2 files will be running at the same time.

I think I have found a better way though. It seems to do exactly what I want it to do, don't know if it's foolproof but here it is:

FileSelectFolder, OutputVar, , 3  ;This allows you to select what folder you will do a recursive search in later.
if OutputVar =   ;if cancelled it exits the script
   ExitApp
else
{
   Loop, %OutputVar%\*.par2, , 1   ;this is the loop that finds all the *.par2 files
   {
      IfNotInString, A_LoopFileFullPath, .vol   ;par files have vol files this excludes running any of the volume files
      {
         Run, %A_LoopFileFullPath% ;this runs the par2 fils from before
         WinWait, QuickPar - Open		; (Wait until QP is running, otherwise the next lines are useless)
         WinWaitClose, QuickPar - Open		; (QP always starts with Open Recovery Files in its title, then changes it to Verifying, All Data Verified, etc.)
         WinWaitClose, QuickPar - Verifying	; (The script must hold until verification of the current window is complete to avoid simultaneous verifications)
      }
   }
msgbox Completed recursive scan for all par2 files
}
return
Might be useful to someone..