I have a root directory with many different sub-directories that have .zip files in them (example below). I need a batch/.cmd/etc to unzip the zip files in their sub directories and rename the extracted file (a .tif) the same as the zip file. I have researched around and found the following code, however this will only work when placed in the sub-directories. Not the parent folder. How to I make this code work through all the sub-directories as explained?
Example File Structure
What I'm Looking for C:\This\Is\Random\Parent\Sub\Sub\1234.tif
set work=%temp%\%random%%random%%random%%random% mkdir "%work%" || goto :eof for %%A in ('dir /b /s *.zip *.rar') do ( "%ProgramFiles%\7-Zip\7z.exe" e -o"%work%" "%%~A" for %%F in ("%work%\*") do move "%%~F" "%%~nA%%~xF" ) rmdir "%work%"