title: Skip when error occurs
body: <p>i have the following code in batch (cmd):</p>
  
  <pre><code>for /f "delims=" %%f in ('dir /b /s Example') do (
  command
  if %errorlevel%==1 (
  command
  SKIP
  )
  command
  )
  </code></pre>
  
  <p><strong>EDIT:</strong>
  To make things more clear:
  <code>for /f...</code> searches for a directory called 'Example' and loops to search for more directories than one.
  the first <code>command</code> is a delete command, it deletes all files in the directory.
  the <code>command</code> that happens when an error occurs, is a <code>echo</code> command which writes some info about the error to a text file.
  now the hole <code>skip</code> thing; sometimes, the files can't be deleted because of <code>access denied</code> or <code>this file is in use by...</code>. Normally, what would happen if there weren't a skip thing, it would just stop the command and hang. So, what i want to do, is prevent this from happening. Alternatively, i want to use something like <code>skip</code>, so it can skip the file and continue anyways. So i think this command needs to be piped in the <code>delete</code> command.</p>
  
  <p>I hope it's clear now.</p>
  
  <p>Thanks in advance.</p>