Batch Script Iterative form
Batch Script Iterative form I have a batch script which : if both of the above statement is true then generate a success file. Below is my code which is working fine: SET /A file1=file2=Val=0 SET /A FileE=1 set /a flagname=1 for %%A in (*ABC*.txt) do set /a file1+=1 for %%A in (*XYZ*.txt) do set /a file2+=1 for %%i in ("*") do if exist "Processed%%~nxi" SET /A FileE=0 SET /A Val=%file1%*%file2%*%FileE% if %Val% EQU 1 ( echo SUCESS>Sucess.txt SET Flag=Sucess echo %Flag%) else ( if %file1% EQU 0 ( echo Missing ABC.txt files >> Error.txt) if %file1% GTR 1 ( echo More than 1 ABC.txt files >> Error.txt) if %file2% EQU 0 ( echo Missing XYZ.txt files >> Error.txt) if %file2% GTR 1 ( echo More than 1 XYZ.txt files >> Error.txt) (for %%i in ("*") do if exist "Processed%%~nxi" echo(File Exists in Processed Folder %%~i)>>Error.txt SET Flag=FAILURE echo %Flag%) My problem is how to transform above code to iterate over a lis...