Ramon Smits

Tell me your secrets and i'll tell you mine

Recent Posts

Tags

Community

Email Notifications

Patterns & Practices / Guidelines

EntLib

Nant

Blogs that I monitor

Archives

Reminder: For loop on the commandprompt

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

Pieter Joost van de Sande said:

Bookmarked as a reminder to :)

# April 16, 2008 6:36 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 3 and 5 and type the answer here: