title: How to append string after file extension via batch file
body: <p>Checking the integrity of zip archives recursively how can i rename bad files in a folder by appending a string after the file extension via a batch file under Windows?
  I tried this script and it gives me no errors but doesn't rename bad files either.</p>
  
  <pre><code>FOR /R \backup %%A IN (*.zip) DO (
     7z t "%%A" | FIND "Everything is Ok" || ((REN "%%A" "%%A.bad") &amp; (ECHO.%%A BAD &gt;&gt; error.log))
  )
  </code></pre>
  
  <p>I have experience in PHP scripting and understand this code block in general (the meaning of the pipe and the logical OR operator). However, i have absolutely no experience in <strong>Batch</strong>-scripting and adopted the script from <a href="http://sourceforge.net/p/sevenzip/discussion/45798/thread/25bb18fb/" rel="nofollow">this source</a>. From what i understand the check receives either an "OK" or adds an entry to the log file and renames the file. The log entry is added, however the renaming is not applied. I don't understand why. Can you tell me what is going wrong and how it would have to look to work as intended?</p>