title: Batch file - Need an Alternative to 7-zip - cannot move
body: <p><strong>Please see updated answer below</strong></p>
  
  <p>Windows Batch files.</p>
  
  <p>I absolutely love 7-Zip and works great, but like WinZip's ability to move and timestamp files.  However, WinZip's (command-line interface) has limitations for the size of files and the quantity of files within an archive, for example.</p>
  
  <p>Googling we do see that there is a person, who did take 7-zip's code and has re-compiled the code to use an -m (move) switch.  However, I don't feel comfortable about using a third-party outside of the Developer of 7-zip in our Production environment.</p>
  
  <p>Also, I have seen - <a href="http://alternativeto.net/software/7-zip/" rel="nofollow">http://alternativeto.net/software/7-zip/</a></p>
  
  <p>I have coded:
  IF NOT ERRORLEVEL 1 (after the Zip process) to delete the file, but this cannot be safe if there are multiple of the same file name structure.</p>
  
  <p>Here are some sample bits of code:
  7zip:</p>
  
  <pre><code>D:\scripts\7za -tzip -y a D\zips\20140116_someclient_%computername%@%location%.zip D:\logs\apache_log.2014-01-16* &gt;nul &gt;&gt;%logfile%
  IF NOT ERRORLEVEL 1 ECHO Y|DEL D:\logs\apache_log.2014-01-16*
  </code></pre>
  
  <p>Where apache_log.2014-01-16
  could be:</p>
  
  <pre><code>apache_log.2014-01-16.1
  apache_log.2014-01-16.2
  apache_log.2014-01-16.3
  </code></pre>
  
  <p>etc.</p>
  
  <p>WinZip</p>
  
  <pre><code>c:\progra~1\WinZip\Wzzip.exe -T -ex -m D\zips\20140116_someclient_%computername%@%location%.zip D:\logs\some_file.2014-01-16* &gt;nul &gt;&gt;%logfile%
  </code></pre>
  
  <p>I guess from a software requirements standpoint, I would like to have some of the abilities of WinZip in 7Zip..  I like 7Zip as it has the ability to work with large Archives.  I like PeaZip and I used PowerArchiver many moons ago.  Problem I have is that I am working with Apache Tomcat for Windows, and we have to archive off hourly logs that can be over 200-300 MB an hour and need to keep the servers clear of old logs.</p>
  
  <p>Hope this makes more sense.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Do believe that I have answered my own question..</p>
  
  <pre><code>FOR /F %%F IN ('dir /B "D:\serverlogs\server.log.2014-01-19*"') DO (
  D:\work\scripts\7za.exe –tzip –y a "D:\ziplogs\201401109_COMPANY_SERVERNAME@DATACENTER.ZIP" &gt;&gt; D:\WORK\SCRIPTS\LOGS\LOG_20140120.LOG &amp;&amp; DEL "D:\serverlogs\%%F"
  )
  </code></pre>
  
  <p>Which this does work well now.</p>