BC_Programmer
Thank you very much - Perfect Solution.
N.B. I have used DOS V3.32 onwards.
I have always used DIR * /A:-D to see all files regardless of attributes.
I was surprised by your use of /A.
I have now inspected DIR /? and can see that [:] is optional,
so /A:-D is the same as /AD
I can also see that no specific attribute needs to be included.
I was not aware this was optional.
I am surprised to observe that I can see all directories and files regardless of attributes with /A
Back to school for me ! !
FOR /F %%A IN ('COMMAND') is something I had problems with some months ago.
I was never sure whether I should be using forward quotes or back quotes,
i.e. keyboard top left or just left of #
When I viewed FOR /? I saw
FOR /F ["options"] %variable IN ('command') DO command [command-parameters]
or, if usebackq option present:
FOR /F ["options"] %variable IN (`command`) DO command [command-parameters]
and I assumed the "usebackq option present" was something pre-existing, either by an option switch when launching CMD.EXE or by a registry hack.
I now realise, after scrolling down a page, it is not a pre-existing thing, but a special modifier within the optional options.
Time for my aspirins ! !
Thank you for your solution, which has led me into a less incomplete understanding of DIR and FOR.
Regards
Alan