Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8393357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:45:43+00:00 2026-06-09T19:45:43+00:00

Just a request for help with batch programming. Need to do periodic backups of

  • 0

Just a request for help with batch programming. Need to do periodic backups of certain folders and was wondering how I would achieve that.

Goal: To Scroll through a directory and compress certain folders with a certain name.

Code Logic:

  //For all directories in folder
  for /d %%X in (*) do (
    if ( %%X != tag_****** )
        "7z.exe" a -ttar "%%X.tar" "%%X\"
  )

.

  for %%X in (*.tar) do 
    "7z.exe" a -tgzip "%%X.tgz" "%%X"

How would I differentiate between folder names in batch if it is possible?

ex: compress tag_aaa111 , skip tag_aaa111_v2 , skip all folders without prefix “tag_”

condition is that the directory starts with tag_ and has exactly 6 chars after that.

Been stuck trying to figure out this. Thanks for the help.

edit: code, clarification.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:45:44+00:00Added an answer on June 9, 2026 at 7:45 pm

    Do you care about the language? If you wanted to use PERL you could do something like:

    while(<*>){
      if(-d && m/^tag_/){
        system("7zip $_"); # Change to whatever compress command you need
      } else {
        #other condition for other files and non matching directories
      }
    }
    

    Where the system will make a system call with whatever parameters are inside of it. The -d will specify whether the file is a directory, and the m// is a regex that matches against the specified pattern

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two websites that post news information. I just got a request to
I've just noticed that if I do a MySQL request like this one: SELECT
I need to hide a div that has a certain string in it, using
I need some help with setting up a cURL request to a page. In
I'm just starting out with the whole ajax thing and I need some help.
So I'm working on this class that's supposed to request help documentation from a
I was just wondering how to request permissions when creating an android application. I
in our application ICEfaces always sends a dispose-window request just before navigating to another
I just enabled Failed Request Tracing for a site and I get a URL_CHANGED
I just a moment ago saw a request for finding the MAC adress of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.