I’m writing a batch file for windows command prompt, I want to loop through files in a directory recursively using FOR /R .
However, inside the loop I want to check if the file of extension .txt or possibly other extensions in order to skip.
How can I do that? in FORFILES there is @ext what to use with for?
Also, is there something similar to regexp in command prompt?
%~xVwill expand variableVto an extension only. If you think you need regexp, then ditch the batch altogether, and use e.g. Python, otherwise you’re only going to be writing unmaintainable mess.Also, for the love of Cthulhu, console window is not even remotely related to MS-DOS.