counter in a FOR ... DO command

January 18, 2011 at 07:37:40
Specs: Windows XP
hi

for /r "c:\xx" /d %%a in (.) do @copy /y "%%a\*.txt" c:\zz

is there a way to know how many files were coppied ? i need that in order to compare the number of files to a var

thanks


See More: counter in a FOR ... DO command

Report •


#1
January 18, 2011 at 08:15:39
Untested

set cnt=0
for /r "c:\xx" /d %%a in (.) do (
    for /f %%b in ('@copy /y "%%a\*.txt" c:\zz ') do set /a cnt+=%%b
)


Report •
Related Solutions


Ask Question