

@echo off

if exist "c:\Program Files\7-Zip\7z.exe" (
    echo  file 7z.exe application exists



) else (
    echo  file doesn't exist and will need to create it to allow 7-zip execute and press any key to continue if you want to copy to c:\Program Files\7-Zip or close by click x at the top right hand screen
    echo you can also install the software on your PC from the folder label 7-zip Software installation   
pause
  mkdir "c:\Program Files\7-Zip"
  COPY /Y "7-Zip\*.*" "c:\Program Files\7-Zip"
)


SETLOCAL ENABLEDELAYEDEXPANSION
set backupFilename=%DATE:~6,4%%DATE:~3,2%%DATE:0,2%
 
set /P targetfile= Enter target directory to unzip : 
set /P targetfilter= Enter type of zip filter : 



for /R "%targetfile%" %%I in ("%targetfilter%") do (
 
  "C:\Program Files\7-Zip\7z.exe" x -y -o"%%~dpnI" "%%~fI"
 
)


if errorlevel 1 goto error
 
echo Success!
echo This is a great success to unzip files.


timeout 2
 




)
goto end


:error
echo Error! There is error to unzip file in the folder. So it will be terminated. 



timeout 10

:end

pause
