Dos

Asked • 07/13/19

Batch File For loop over a list of file extensions with exclusions?

Say i have the following files in a directory* /file.js* /file2.min.js* /file1.jshow can i write a batch for loop such that all ".js" files are picked up but ".min.js" are not and the output of the .js filename can be changed to append .min.jseg: for %%A IN (*.js) DO @echo %%A "->" %%~nA ".min.js"would ideally produce the following, and note the file2.min.js is not displayed to the left.* file.js -> file.min.js* file1.js -> file1.min.jsThanks for your help.

1 Expert Answer

By:

Rize S. answered • 03/23/23

Tutor
New to Wyzant

Senior IT Certified Trainer, IT Developer & DBA Administrator

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.