I am making use of the below script, in order to check a specific folder for files.
If no of files is >= 1 , another .bat is to be called, (and must run as many times as the number of files in this folder) ... after that:
If no of files is 0 (zero), the execution of the actual .bat should be sttoped.
@echo on & setLocal EnableDELAYedeXpansion
dir /b /a-d dir_1>files_to_load.txt
move files_to_load.txt dir_2
for /f %%a in (dir_2\files_to_load.txt) do ( set /a count+=1)
if %count% EQU 0 (
echo No files found in the specified folder>>FolderCounter.log
) else (
for /L %%b in (1 1 %count%) do call dir_3\MainBat.bat %%b
echo U ngarkuan !count! skedar gjithsej>> dir_2\files_to_load.txt
move FolderCounter.log dir_2
Well, I tested the above, but it doesn't stop when all files in the folder are procesed.
thank you all
Actually I just need a .bat to check if there are any files in the folder:
If yes ... than call the other.bat
If no ... than exit