I have a folder on my Windows system with the following contents:
c:\folder\folder1 c:\folder\folder2 c:\folder\folder3 c:\folder\folder4 c:\folder\folder5 c:\folder\folder6 c:\folder\A.bat c:\folder\b.bat
I want to run a batch file that leaves only
and deletes the rest. I.e., delete all sub-folders, irrespective of whether they contain files themselves, and retain only the "top level" files.
How can I do this?