Using a .bat script for 7z.exe on Windows, I'm trying to extract all .zip files to a folder with the same name. I want all output folders to stay in their respective subdirectories. Thanks to Extract all Zip's in a directory (incl. subfolders) with a .bat file or dos command, I've been able to do this.
However, there is one directory (~\00Z) I want to exclude from the loop. I referenced 7Zip - Command Line : Exclude folder(s) by wildcard pattern? and tried to use the -x switch, but I haven't been successful. What am I doing wrong? The following code successfully extracts all .zip files, but does not exclude the 00Z directory from the batch process.
for /F "DELIMS=" %%I IN ('dir /b /s *.zip') DO (
"C:\Program Files\7-Zip\7z.exe" x -aos -o"%%~dpnI" "%%I" -x!00Z
)
for /F "DELIMS=" %%I IN ('dir /b /s *.zip') DO (
"C:\Program Files\7-Zip\7z.exe" x -aos -o"%%~dpnI" "%%I" -xr!00Z\*.zip
)