troubleshooting Question

Batch file looping

Avatar of TheShaner
TheShaner asked on
Microsoft DOS
7 Comments2 Solutions1154 ViewsLast Modified:
Can someone show me how to work loops in a DOS batch file?  At the most basic level, I could give the following example.

Loop using a counter..  A do while if you will.  I guess an easy example would be something like this.  

Create 50 directories.  All with the same name, only with a number at the end of it.  And stop when I hit 50


Also, does anyone know any good reasources for learning this kind of stuff?  I am pretty handy in writing batch files, but would really like to take things to the next level and add some real complexity to them.



Steve Knight
IT Consultancy

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros