for /r %%I IN (' *.zip ') DO (
"C:\Program Files\7-Zip\7z.exe" x -o"%%~dpnI" "%%I"
)
pause
Hi, I got this batch command online that unzips files recursively. I would like to understand what the For loop does in this case.
I'm asking this question because I receive errors when running the bat file because the command also picks folders and files of other extensions apart froma *.zip and throws the following error.
D:\Unzip_folders\New folder>("C:\Program Files\7-Zip\7z.exe" x -o"D:\Unzip_folders\New folder\23Nov2015\error_log.17112015\'" "D:\Unzip_folders\New folder\23Nov2015\error_log.17112015\'" )
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
Scanning the drive for archives:
ERROR: The system cannot find the file specified.
D:\Unzip_folders\New folder\23Nov2015\error_log.17112015\'