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 6359327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:30:13+00:00 2026-05-24T23:30:13+00:00

for /F tokens=* %* in (Test.txt) do md .\%* & cd %* & md

  • 0
for /F "tokens=*" %* in (Test.txt) do md ".\%*" & cd "%*" & md "Something1" & md "Something2" & cd ".."

The DOS command will pull names from text file and create a named folder then two subfolders.

Apple
-Something1
-Something2

But when I put it into a batch file as follows:

@ECHO OFF
@for /F "tokens=*" %* in (Test.txt) do md ".\%*" & cd "%*" & md "Something1" & md "Something2" & cd ".."
ECHO Done
PAUSE

Then run it from Windows GUI a sreen pops up, closes, and does nothing. Even if I create a batch with the working DOS command it does nothing. What am I missing?

Thank you.

  • 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-24T23:30:14+00:00Added an answer on May 24, 2026 at 11:30 pm

    In batch files, you need to double the ‘%’ in the for variable. Don’t ask me why. 🙂

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

Sidebar

Related Questions

I have the following ant task: <target name=test> <replace file=test.txt token=smth value=anything/> </target> test.txt
LIST *list; list = createList(); FILE *file = fopen(test.txt,r); char line[50]; char* token; while(fgets(line,sizeof(line),file))
I am using a dos batch which processes file using passed parameter: process.bat D:\PROJECT\TEST
for /F tokens=* %* in (C:\Test.txt) do (md C:\TEMP\%* || cd C:\TEMP\%* || md
In its enthusiasm to stemm tokens into lexemes , PostgreSQL Full Text Search engine
I am writing a Java program that inputs a test file, performs some modifications
This is my requirement in windows batch file I tried the following Example: f1.txt
I need to divide a C string into tokens. I thought that strtok will
I have a text file with a list of file paths. For example, they
I can't get the list of my test users with my app access token.

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.