<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Mass Zip, RAR to 7Zip Recompression Batch File</title>
	<atom:link href="http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/feed" rel="self" type="application/rss+xml" />
	<link>http://aarmstrong.org</link>
	<description>Website and journal of Andrew Armstrong</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:38:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: NUNU</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-36321</link>
		<dc:creator>NUNU</dc:creator>
		<pubDate>Mon, 23 Jan 2012 08:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-36321</guid>
		<description>Hi Andrew i need your help
I have one of  above program to extract the zip file but  I want to extract the file to the designation folder  from source folder when ever i run the batch file

Thanks a lot</description>
		<content:encoded><![CDATA[<p>Hi Andrew i need your help<br />
I have one of  above program to extract the zip file but  I want to extract the file to the designation folder  from source folder when ever i run the batch file</p>
<p>Thanks a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yuvraj</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-30831</link>
		<dc:creator>yuvraj</dc:creator>
		<pubDate>Thu, 20 Oct 2011 06:47:26 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-30831</guid>
		<description>Hi Andrew i need your help on the previous comments

As per my previous mail i used following command to suppressed Overwritten message.
 set COPYCMD=/-Y

But i am not able to suppressed Overwritten message.
Is any another way to do the same.

thanks in advanced</description>
		<content:encoded><![CDATA[<p>Hi Andrew i need your help on the previous comments</p>
<p>As per my previous mail i used following command to suppressed Overwritten message.<br />
 set COPYCMD=/-Y</p>
<p>But i am not able to suppressed Overwritten message.<br />
Is any another way to do the same.</p>
<p>thanks in advanced</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yuvraj</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-30829</link>
		<dc:creator>yuvraj</dc:creator>
		<pubDate>Thu, 20 Oct 2011 06:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-30829</guid>
		<description>i have the following program to extract the zip file  which is in c:\ source  to designation folder when ever i run the batch file i get message 
 already exit override with   i don&#039;t want this message is there i way to suppress this message 


@echo off

setlocal enabledelayedexpansion

set SOURCE_DIR=C:\Source
set DEST_DIR=C:\Destination
set FILENAMES_TO_COPY=*.7z *.zip 
set COPYCMD=/-Y
ECHO Searching for RAR and ZIP files to recompress into 7zip archives.
for /R &quot;%SOURCE_DIR%&quot; %%F IN (%FILENAMES_TO_COPY%) do (
ECHO File %%F
	IF NOT EXIST &quot;%%~nF.zip  &quot; (
	 	ECHO in 7z %%F
		REM Extract...
		&quot;C:\Program Files\7-Zip \7z&quot; x &quot;%%F&quot; -o&quot;%%F contents&quot;
		REM Does the directory exist? has 7zip created it correctly?
		IF EXIST &quot;%%F contents&quot; (
			REM Change directory, create 7zip of contents of directory...
			CD &quot;%%F contents&quot;
			&quot;C:\Program Files\7-Zip\7z&quot; a -tzip &quot;../%%~nF.zip &quot; * -mx=9
			REM CD ..
			

			
			REM Delete the old files
			DEL &quot;%%F&quot; /F /Q
			RMDIR &quot;%%F contents&quot; /S /Q
			ECHO Recompressed %%F to %%~nF.zip  and deleted %%F.
		)
	)	
)

for /R &quot;%SOURCE_DIR%&quot; %%F IN (%FILENAMES_TO_COPY%) do (
	IF EXIST &quot;%%~nF.zip &quot; ( 
	 	ECHO in zip %%~nF
		set FILE_DIR=%%~dpF
		set FILE_INTERMEDIATE_DIR=!FILE_DIR:%SOURCE_DIR%=!
		&quot;C:\Program Files\7-Zip \7z&quot; x &quot;%%~nF.zip &quot; -o&quot;%DEST_DIR%!FILE_INTERMEDIATE_DIR!&quot; 
		
	)
)</description>
		<content:encoded><![CDATA[<p>i have the following program to extract the zip file  which is in c:\ source  to designation folder when ever i run the batch file i get message<br />
 already exit override with   i don&#8217;t want this message is there i way to suppress this message </p>
<p>@echo off</p>
<p>setlocal enabledelayedexpansion</p>
<p>set SOURCE_DIR=C:\Source<br />
set DEST_DIR=C:\Destination<br />
set FILENAMES_TO_COPY=*.7z *.zip<br />
set COPYCMD=/-Y<br />
ECHO Searching for RAR and ZIP files to recompress into 7zip archives.<br />
for /R &#8220;%SOURCE_DIR%&#8221; %%F IN (%FILENAMES_TO_COPY%) do (<br />
ECHO File %%F<br />
	IF NOT EXIST &#8220;%%~nF.zip  &#8221; (<br />
	 	ECHO in 7z %%F<br />
		REM Extract&#8230;<br />
		&#8220;C:\Program Files\7-Zip \7z&#8221; x &#8220;%%F&#8221; -o&#8221;%%F contents&#8221;<br />
		REM Does the directory exist? has 7zip created it correctly?<br />
		IF EXIST &#8220;%%F contents&#8221; (<br />
			REM Change directory, create 7zip of contents of directory&#8230;<br />
			CD &#8220;%%F contents&#8221;<br />
			&#8220;C:\Program Files\7-Zip\7z&#8221; a -tzip &#8220;../%%~nF.zip &#8221; * -mx=9<br />
			REM CD ..</p>
<p>			REM Delete the old files<br />
			DEL &#8220;%%F&#8221; /F /Q<br />
			RMDIR &#8220;%%F contents&#8221; /S /Q<br />
			ECHO Recompressed %%F to %%~nF.zip  and deleted %%F.<br />
		)<br />
	)<br />
)</p>
<p>for /R &#8220;%SOURCE_DIR%&#8221; %%F IN (%FILENAMES_TO_COPY%) do (<br />
	IF EXIST &#8220;%%~nF.zip &#8221; (<br />
	 	ECHO in zip %%~nF<br />
		set FILE_DIR=%%~dpF<br />
		set FILE_INTERMEDIATE_DIR=!FILE_DIR:%SOURCE_DIR%=!<br />
		&#8220;C:\Program Files\7-Zip \7z&#8221; x &#8220;%%~nF.zip &#8221; -o&#8221;%DEST_DIR%!FILE_INTERMEDIATE_DIR!&#8221; </p>
<p>	)<br />
)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bighead</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-29780</link>
		<dc:creator>Bighead</dc:creator>
		<pubDate>Mon, 03 Oct 2011 23:11:30 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-29780</guid>
		<description>Just for the heck of it, I decided to take it a bit further. Instead of spamming a bunch of code in this comment box, I&#039;ll just add a link where I&#039;m hosting it if anyone wants to try it out:
http://bmgcl.emuxhaven.net/downloads.htm  -  Scroll to the bottom of the page.

Now the script can: Check for zip/rar files, decompress, recompress into 7z, compare, delete the larger file, error check if the archive is corrupt, and output all actions into a log file. It does pretty much everything that you mentioned was missing, besides counting the number of files converted. I did not add this  because I felt it was kind of redundant, the user should know how many files he/she is attempting to convert. Besides, the log will display ERROR if contents did not extract. Maybe I&#039;ll add it in the future if I&#039;m bored...

I made sure to give credit to Andrew for this wonderful script, it has helped me in so many ways.</description>
		<content:encoded><![CDATA[<p>Just for the heck of it, I decided to take it a bit further. Instead of spamming a bunch of code in this comment box, I&#8217;ll just add a link where I&#8217;m hosting it if anyone wants to try it out:<br />
<a href="http://bmgcl.emuxhaven.net/downloads.htm" rel="nofollow">http://bmgcl.emuxhaven.net/downloads.htm</a>  &#8211;  Scroll to the bottom of the page.</p>
<p>Now the script can: Check for zip/rar files, decompress, recompress into 7z, compare, delete the larger file, error check if the archive is corrupt, and output all actions into a log file. It does pretty much everything that you mentioned was missing, besides counting the number of files converted. I did not add this  because I felt it was kind of redundant, the user should know how many files he/she is attempting to convert. Besides, the log will display ERROR if contents did not extract. Maybe I&#8217;ll add it in the future if I&#8217;m bored&#8230;</p>
<p>I made sure to give credit to Andrew for this wonderful script, it has helped me in so many ways.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bighead</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-29658</link>
		<dc:creator>Bighead</dc:creator>
		<pubDate>Sat, 01 Oct 2011 12:05:40 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-29658</guid>
		<description>I came across this because I was looking for exactly this. Thank you! I especially liked the script to recompress into 7z then delete the original archive. But like you mentioned,  in some cases the RAR or ZIP may have a better compression ratio. I have modified the script a bit. After it is done compressing, it uses loops to compare the two files, output the archive name, 7z size, rar/zip size, and keep the smaller of the two. Here it is to anyone who is interested:

@ECHO OFF
REM Find all .zip and .rar files in the current directory, recompress them into 7zip files and delete the smaller version.
ECHO Searching for RAR and ZIP files to recompress into 7-Zip archives.
FOR %%F IN (*.rar *.zip) DO (
    ECHO Found %%F to recompress...
    REM Extract contents from the original file.
    &quot;C:\Program Files\7-Zip\7z&quot; x &quot;%%F&quot; -o&quot;%%F contents&quot;
    REM Check to see if 7-zip created the directory.
    IF EXIST &quot;%%F contents&quot; (
        REM Change directory, create 7zip of contents of directory.
        CD &quot;%%F contents&quot;
        &quot;C:\Program Files\7-Zip\7z&quot; a -t7z &quot;../%%~nF.7z&quot; * -m0=lzma -mx=9 -mmt2 -md=128m -ms=off
        CD ..
        REM Compare the RAR or Zip to the 7z, choose the smaller file, and cleanup the directory.
        FOR %%G IN (*.7z) DO (
            IF %%~nF == %%~nG (
                ECHO.
                ECHO Archive       : %%~nF
                ECHO 7-Zip Size    : %%~zG Bytes
                ECHO Original Size : %%~zF Bytes
                ECHO.
                IF %%~zF GTR %%~zG (
                    DEL &quot;%%F&quot; /F /Q
                    ECHO The 7z archive has a higher compression ratio. 
                    ECHO Deleting the original archive.
                ) ELSE (
                    DEL &quot;%%G&quot; /F /Q
                    ECHO The original archive has a higher compression ratio. 
                    ECHO Deleting the 7z archive.
                )
                ECHO.
            )
        )
        RMDIR &quot;%%F contents&quot; /S /Q
    )
)
ECHO Search has ended.
ECHO.
ECHO Press any key to close this window.
PAUSE &gt; nul</description>
		<content:encoded><![CDATA[<p>I came across this because I was looking for exactly this. Thank you! I especially liked the script to recompress into 7z then delete the original archive. But like you mentioned,  in some cases the RAR or ZIP may have a better compression ratio. I have modified the script a bit. After it is done compressing, it uses loops to compare the two files, output the archive name, 7z size, rar/zip size, and keep the smaller of the two. Here it is to anyone who is interested:</p>
<p>@ECHO OFF<br />
REM Find all .zip and .rar files in the current directory, recompress them into 7zip files and delete the smaller version.<br />
ECHO Searching for RAR and ZIP files to recompress into 7-Zip archives.<br />
FOR %%F IN (*.rar *.zip) DO (<br />
    ECHO Found %%F to recompress&#8230;<br />
    REM Extract contents from the original file.<br />
    &#8220;C:\Program Files\7-Zip\7z&#8221; x &#8220;%%F&#8221; -o&#8221;%%F contents&#8221;<br />
    REM Check to see if 7-zip created the directory.<br />
    IF EXIST &#8220;%%F contents&#8221; (<br />
        REM Change directory, create 7zip of contents of directory.<br />
        CD &#8220;%%F contents&#8221;<br />
        &#8220;C:\Program Files\7-Zip\7z&#8221; a -t7z &#8220;../%%~nF.7z&#8221; * -m0=lzma -mx=9 -mmt2 -md=128m -ms=off<br />
        CD ..<br />
        REM Compare the RAR or Zip to the 7z, choose the smaller file, and cleanup the directory.<br />
        FOR %%G IN (*.7z) DO (<br />
            IF %%~nF == %%~nG (<br />
                ECHO.<br />
                ECHO Archive       : %%~nF<br />
                ECHO 7-Zip Size    : %%~zG Bytes<br />
                ECHO Original Size : %%~zF Bytes<br />
                ECHO.<br />
                IF %%~zF GTR %%~zG (<br />
                    DEL &#8220;%%F&#8221; /F /Q<br />
                    ECHO The 7z archive has a higher compression ratio.<br />
                    ECHO Deleting the original archive.<br />
                ) ELSE (<br />
                    DEL &#8220;%%G&#8221; /F /Q<br />
                    ECHO The original archive has a higher compression ratio.<br />
                    ECHO Deleting the 7z archive.<br />
                )<br />
                ECHO.<br />
            )<br />
        )<br />
        RMDIR &#8220;%%F contents&#8221; /S /Q<br />
    )<br />
)<br />
ECHO Search has ended.<br />
ECHO.<br />
ECHO Press any key to close this window.<br />
PAUSE &gt; nul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-11526</link>
		<dc:creator>John</dc:creator>
		<pubDate>Sat, 02 Oct 2010 17:40:16 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-11526</guid>
		<description>Jorge,

I believe your answer is here.  Its a matter of changing one small part to compress directories rather than files. http://commandwindows.com/batchfiles-iterating.htm</description>
		<content:encoded><![CDATA[<p>Jorge,</p>
<p>I believe your answer is here.  Its a matter of changing one small part to compress directories rather than files. <a href="http://commandwindows.com/batchfiles-iterating.htm" rel="nofollow">http://commandwindows.com/batchfiles-iterating.htm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Armstrong</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-11273</link>
		<dc:creator>Andrew Armstrong</dc:creator>
		<pubDate>Thu, 30 Sep 2010 09:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-11273</guid>
		<description>I&#039;ve no idea how you&#039;d start this, these scripts just work on recompressing Zip files, not folders! You&#039;d need to edit it pretty heftily depending on what you need to do.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve no idea how you&#8217;d start this, these scripts just work on recompressing Zip files, not folders! You&#8217;d need to edit it pretty heftily depending on what you need to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorge Segovia</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-11242</link>
		<dc:creator>Jorge Segovia</dc:creator>
		<pubDate>Thu, 30 Sep 2010 02:46:30 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-11242</guid>
		<description>Hey Andrew,
Good job, I would like that you can explain how to compress folders with 7-zip using a .bat file. See, in my job, I need to compress a packet of folders in a .zip file using a .bat file, but I need to control what folders will be zipped, because not everyone will be zipped as well the .bat file must run daily I need to have control of that too. 

I cannot find the information that a need to do this, I hope you can help me with this, thanks a lot.

regards from Mexico</description>
		<content:encoded><![CDATA[<p>Hey Andrew,<br />
Good job, I would like that you can explain how to compress folders with 7-zip using a .bat file. See, in my job, I need to compress a packet of folders in a .zip file using a .bat file, but I need to control what folders will be zipped, because not everyone will be zipped as well the .bat file must run daily I need to have control of that too. </p>
<p>I cannot find the information that a need to do this, I hope you can help me with this, thanks a lot.</p>
<p>regards from Mexico</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-5215</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 25 Mar 2010 10:29:03 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-5215</guid>
		<description>Excellent job!!! 

Hope that features like these will soon be added to 7-zip&#039;s shell extension.

Thanks a lot!</description>
		<content:encoded><![CDATA[<p>Excellent job!!! </p>
<p>Hope that features like these will soon be added to 7-zip&#8217;s shell extension.</p>
<p>Thanks a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry</title>
		<link>http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file/comment-page-1#comment-4842</link>
		<dc:creator>Larry</dc:creator>
		<pubDate>Fri, 19 Feb 2010 17:28:45 +0000</pubDate>
		<guid isPermaLink="false">http://aarmstrong.org/?page_id=509#comment-4842</guid>
		<description>Nice! I made some changes to my version to add error checking.
Basically I check the ERRORLEVEL returned by the 7zip calls to make sure I am not recompressing bad zip/rar files and 7zip compression part did not fail.</description>
		<content:encoded><![CDATA[<p>Nice! I made some changes to my version to add error checking.<br />
Basically I check the ERRORLEVEL returned by the 7zip calls to make sure I am not recompressing bad zip/rar files and 7zip compression part did not fail.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

