title: How to create bat file that zip all folders using winzip?
body: <p>I want to create a bat file that compresses all the folders inside a specific directory and then deletes them.
  For example,
  Folder structure (before running bat file):</p>
  
  <pre><code>VidoesArch
        January
        February
        March
        ....
    TextualArch
        January
        February
        March
        ....
  
  
  Folder structure (after running bat file):
    VideosArch
        January.zip
        February.zip
        March.zip
        ....
    TextualArch
        January.zip
        February.zip
        March.zip
        ....
  </code></pre>
  
  <p>This what I have developed so far:</p>
  
  <pre><code>@echo off
  setlocal
  set INPBKP=C:\Data\Backup\VideosArch
  set OUTBKP=C:\Data\Backup\TextualArch
  set WZLOC=C:\PROGRA~2\WINZIP
  
  :: Caution: Use a drive where sufficient disk space is available for this setting.
  set WORKDIR=K:\
  
  :: DO NOT CHANGE ANYTHING BEYOND THIS POINT
  
  set COMPCMD="%WZLOC%\WZZIP.EXE" -m -ex -b%WORKDIR% -a 
  
  for /F "USEBACKQ DELIMS==" %%t in (`dir %INPBKP%\*.dat /a/s/b`) do @%COMPCMD% %%t.zip %%t
  for /F "USEBACKQ DELIMS==" %%t in (`dir %OUTBKP%\*.dat /a/s/b`) do @%COMPCMD% %%t.zip %%t
  
  endlocal
  </code></pre>
  
  <p>What this file does is, it zip all the .dat files in the folders. What I want to achieve is it shall zip all the folders.</p>
  
  <p>Update:</p>
  
  <p>I have changed the file content and now it looks like this. Its not working. If I try to run on command prompt it says- 'The system cannot find the file specified'.</p>
  
  <pre><code>@echo off
  setlocal
  set INPBKP=C:\Data\Backup\VideosArch
  set OUTBKP=C:\Data\Backup\TextualArch
  set WZLOC=C:\PROGRA~2\WINZIP
  
  :: Caution: Use a drive where sufficient disk space is available for this setting.
  set WORKDIR=C:\
  
  :: DO NOT CHANGE ANYTHING BEYOND THIS POINT
  
  set COMPCMD="%WZLOC%\WZZIP64.EXE" -r -p -m -ex -b%WORKDIR%
  
  for %%s in ("%INPBKP%" "%OUTBKP%") do for /F "DELIMS==" %%t in ('dir %%s /ad /b') do %COMPCMD% %%~nt.zip "%%~s\%%t"
  
  endlocal
  </code></pre>