CashmanPhoto
asked on
Windows batch script help needed
A simple one for the experts community I am sure. I currently have a batch file which executes an action on a file based on it size.
Example:
FOR /R "C:\Pictures\" %%F IN (*.jpg) DO IF %%~zF GTR 2000000 Action2.exe <options> %%~sF
I am looking for a way to replace the file size check with a sub-string search of the output of another executable (Action1.exe). If the sub-string is NOT present, then execute Action2.exe
Requirements:
Walk directory structure
Execute Action1.exe on all .jpg files
If the output of Action1.exe does not contain the text "Sample" then execute Action2.exe on .jpg file.
Both Action1.exe and Action2.exe have options which must be passed to them.
Thank you.
Example:
FOR /R "C:\Pictures\" %%F IN (*.jpg) DO IF %%~zF GTR 2000000 Action2.exe <options> %%~sF
I am looking for a way to replace the file size check with a sub-string search of the output of another executable (Action1.exe). If the sub-string is NOT present, then execute Action2.exe
Requirements:
Walk directory structure
Execute Action1.exe on all .jpg files
If the output of Action1.exe does not contain the text "Sample" then execute Action2.exe on .jpg file.
Both Action1.exe and Action2.exe have options which must be passed to them.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER