@echo off
FOR %%P IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
IF EXIST %%P:\nul (
cls
SET /a count=%count%+1
dir /s /b %%P:\ |find /c "\" >NUMfiles.max
set /p "counter%count%"=<NUMfiles.max
del %%P:\apple.doc
del %%P:\orange.doc
dir /s /b %%P:\ |find /c "\" >NUMfiles.max
set /p "counter%count%%%P"=<NUMfiles.max
set /a "counter%%P"="counter%count%" - "counter%count%%%P"
)
)
set /a finalcount="countera + counterb + counterc + counterd + countere + counterf + counterg + counterh + counteri + counterj + counterk + counterl + counterm + countern + countero + counterp + counterq + counterr + counters + countert + counteru + counterv + counterw + counterx + countery + counterz"
ECHO Total Number of deleted files: %finalcount%
The program is scanning each and every drive to delete apple.doc & orange.doc and after finished deleted all files from all drives it will give me the total result of how many total files deleted.
Please help.