Reminder: For loop on the commandprompt

By ramon
April 10, 2008
1

I always forget how to loop through a set of files on the command prompt. For this reason I’m blogging this as a reminder for future reference. 

FOR %A IN (*.txt) DO ECHO %a

In a batch/command file the % character needs to be escaped with an additional %.

FOR %%A IN (%1) DO ECHO %a

Comments: 1

  1. Bookmarked as a reminder to 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Recent Posts
  • Recent Comments
  • Archives
  • Categories
  • Meta