I see
C:%directoryofinterest%>RD"C:%directoryofinterest\AppData\Local"
The filename, directory name, or volume label syntax is incorrect.
repeated a bunch of times for each folder in the batch.
I think I may be misunderstanding your
Put every line between << " >>
I thought you meant put every line in quotation marks, and then put "RD" in front of it. Not so?
By the way, I don't have an ASCII editor that I am aware of, and I don't have admin privileges to install on my work computer, so I used MS Word find and replace to replace every ^p with "^p", and then put the " in front of the first line and deleted the
extraneous last ", then did similar for RD, with "Use wildcards" unchecked, and then I just opened the .bat file in notepad and pasted the modified text from Word into it. Do I need to generate it with an ASCII editor for the syntax to be correct?
Also, as I believe somebody mentioned above, the DIR-empty.bat file produced by the intial command contains *every* directory, not just empty ones. Is the RD "~" step supposed to apply a filter to get to the actual empty ones?