Nested for loop/ for loop inside for loop in Batch File Programming

Publié le: 13 mars 2018
sur la chaîne: Ritwik Dasgupta
4,185
47

Hi friends,
Here we have discussed about how to use a for loop inside a for loop ie. nested For loop and the syntax is
FOR %%A IN (set) DO FOR %%B IN (set) DO Command

examples:
simple nested.bat
@echo off
FOR %%A IN (1 2 3) DO FOR %%B IN (A B C) DO ECHO %%A%%B
pause

simple nested - using goto.bat
@Echo Off
Setlocal
For %%A in (1 2) DO (
Echo Outer loop %%A
call :inner
)
pause
goto :eof

:inner
For %%B in (A B) DO (
echo Inner loop Outer=%%A Inner=%%B
)
Previous for loop links
Normal for loop:    • For /R, For /D, For /L Loop in Batch File ...  
for /f:    • If/Else, Nested If/Else Statements in Batc...  
Please subscribe and stay tuned for more technology updates. Thank you


Sur cette page du site, vous pouvez voir la vidéo en ligne Nested for loop/ for loop inside for loop in Batch File Programming durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Ritwik Dasgupta 13 mars 2018, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 4,185 fois et il a aimé 47 téléspectateurs. Bon visionnage!