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

  • Home
  • SEARCH
  • 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 625723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:20:26+00:00 2026-05-13T19:20:26+00:00

Hello I need a batch file to store in a variable all paths of

  • 0

Hello I need a batch file to store in a variable all paths of all directories/subdirectories named “.svn” that I can found in my_folder.

Something like:

@ECHO OFF
FOR /r my_folder %%X IN (.svn) DO (ECHO %%X)

the command above prints them to screen, but I need to store them in a variable as a list of strings. Someone knows how to do it?

This is the site I use for helping myself with batch files: http://ss64.com/nt/

After I want to pass the value of such variable to the command RD in order to delete them along with this subfolders/files.
So let’s say the variable is names $a i will do something like:

RD /s /q $a
  • 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-05-13T19:20:27+00:00Added an answer on May 13, 2026 at 7:20 pm

    The simplest solution without any variables is to issue the RD command inside your FOR loop. You can use multiple commands inside the braces like:

    @ECHO OFF
    FOR /r my_folder %%X IN (.svn) DO (
        ECHO %%X
        RD /s /q %%X
    )
    

    If yo need the to add the pathes to a variable you can do it like that:

    @ECHO OFF
    
    SET PATH_LIST=
    SETLOCAL ENABLEDELAYEDEXPANSION   
    
    FOR /r my_folder %%X IN (.svn) DO (
        ECHO %%X
        SET PATH_LIST=!PATH_LIST! "%%X"
    )
    
    ENDLOCAL
    
    RD /s /q %PATH_LIST%
    

    But keep in mind that environment variables are limited in size. In Windows XP a single variable can hold a max. of 8,192 bytes.

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

Sidebar

Ask A Question

Stats

  • Questions 516k
  • Answers 516k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Any particular reason you want the Observer pattern? It's not… May 16, 2026 at 6:55 pm
  • Editorial Team
    Editorial Team added an answer You should look into SASS, specifically their "Mixins" feature. It… May 16, 2026 at 6:55 pm
  • Editorial Team
    Editorial Team added an answer This works (provided you have the correct API key, subject… May 16, 2026 at 6:55 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Hello I need to check if two lists have same elements in same order
Hello i need to use writerreaderlock in my method. I want to know how
Hello i need to highlight a div after my page is loading, i don't
Hello I need to generate a report which would include both data and a
I have a string like hello /world today/ I need to replace /world today/
Hello I'd like to list all real users on Linux/*nix and it's data. I
hello i got a problem with comparing two char* variables that contains numbers for
Hello I have a problem while trying to run a makefile. I change the
I need to know the status of a service at the end of my
Update: Last night, I decided that this is just too much work to change

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.