title: Batch Re-compress Multiple archives into 7z
body: <p>I am trying to write a batch file to find all zip, rar, tar.gz and re-compress them as a 7zip self executable. I am able to get it to store the files found and scanning trough them but i cannot seem to get it to compress... or everything in the do() to work. I also need it to store the text file so i can check before it starts the process and remove any unnecessary files</p>
  
  <pre><code>@echo off
  ::Scan for archives and store to file
  dir /b /x *.*  |  find "rar" &gt; rfound.txt
  dir /b /x *.*  |  find "zip" &gt; zfound.txt
  dir /b /x *.*  |  find "tar.gz" &gt; tfound.txt
  
  echo Please check found files then hit enter
  pause&gt;nul
  
  ::Uncompress and recompress as 7z
  for /f "tokens=1 delims=;" %%i in (rfound.txt) do ( 7za.exe e -y -otmp %%i * &amp; pushd tmp &amp; ..\7za.exe a -y -r -t7z ..\%%i * &amp; popd &amp; rmdir /s /q tmp )
  for /f "tokens=1 delims=;" %%i in (zfound.txt) do ( 7za.exe e -y -otmp %%i * &amp; pushd tmp &amp; ..\7za.exe a -y -r -t7z ..\%%i * &amp; popd &amp; rmdir /s /q tmp )
  for /f "tokens=1 delims=;" %%i in (tfound.txt) do ( 7za.exe e -y -otmp %%i * &amp; pushd tmp &amp; ..\7za.exe a -y -r -t7z ..\%%i * &amp; popd &amp; rmdir /s /q tmp )
  
  pause
  </code></pre>