You can use the FOR command:
FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]
Projects a directory tree on the root path [drive:], executing FOR in each directory of the tree. If no directory specification is specified after / R, then the current directory is assumed. If only one period (.) Is set, then it will simply list the directory tree.
In your case, this should work:
FOR /R d:\data %a IN (*.dtd) DO "C:\Program Files (x86)\Notepad++\notepad++.exe" "%a"
Use %%a if you need to run it from a batch file
If you want to use multiple extensions, you can highlight them with a space
FOR /R d:\data %a IN (*.dtd *.xml *.xslt) DO "C:\Program Files (x86)\Notepad++\notepad++.exe" "%a"
source share