Batch to loop through all files with predefined list or set of extensions and ignore all other file types

Viewed 1621

I have following windows-batch script to loop through all files in the current directory:

FOR %%F in (%CD%\*.*) DO (
    :: I am doing my process here
)

I know I can loop through a specific file type by using *.ext, but I need to loop through all the given below file types and ignore all other types, that also in single FOR loop only:

php
phtml
css
js
sql
xml

How can I achieve that by doing slightest modifications to my code as possible ?

I am not much of a batch-scripter, so any help would be much appreciated.

1 Answers
Related