Done

This is the line that does it...
The syntax is as follows...
i.e. mine does this
for E:\ofoggi\gui and all it's subfolders find all files ending
in .r
do search for same file but ending in .p if it isn't there search for the same file ending in .w if that isn't there then write the file name to a txt file.
The hardest bit to find was the variable editing stuff.
The file path is %%X
%%~dX will return the drive letter i.e. "E:"
%%~pX will return the path i.e. "\ofoggi\gui\subfolder\"
%%~nX will return the filename without the extension i.e. "somefile"
(All this came from
HERE)
I may change the echo to just del the files instead.
If you are doing this from a command line (not a batch file) then only use single %s. doubles %s are used for batch files.