title: Batch File to Compress Certain Directories with 7zip?
body: <p>Just a request for help with batch programming.  Need to do periodic backups of certain folders and was wondering how I would achieve that.</p>
  
  <p>Goal: To Scroll through a directory and compress certain folders with a certain name.</p>
  
  <p>Code Logic:</p>
  
  <pre><code>  //For all directories in folder
    for /d %%X in (*) do (
      if ( %%X != tag_****** )
          "7z.exe" a -ttar "%%X.tar" "%%X\"
    )
  </code></pre>
  
  <p>.</p>
  
  <pre><code>  for %%X in (*.tar) do 
      "7z.exe" a -tgzip "%%X.tgz" "%%X"
  </code></pre>
  
  <p>How would I differentiate between folder names in batch if it is possible?</p>
  
  <p>ex: compress tag_aaa111 , skip tag_aaa111_v2 , skip all folders without prefix "tag_"</p>
  
  <p>condition is that the directory starts with tag_ and has exactly 6 chars after that.</p>
  
  <p>Been stuck trying to figure out this. Thanks for the help.</p>
  
  <p>edit: code, clarification.</p>