cmd windows for loop code example
Example 1: cmd for loop
REM
For %F in (*) do copy %F C:\User\
REM
REM
REM
REM
@echo off
setlocal
set file=C:\Users\l72rugschiri\Desktop\fs.cfg
for %%N IN ("%file%") do (
echo filedrive=%%~dN
echo filepath=%%~pN
echo filename=%%~nN
echo fileextension=%%~xN
echo default=%%N
)
Example 2: batch windows for
syntax-FOR-List of numbers
FOR /L %%parameter IN (start,step,end) DO command
syntax-FOR-Command Results
FOR /F ["options"] %%parameter IN ('command to process') DO command