title: Windows CMD or BATCH file that "flags" empty folders (and folders that only contain empty folders)
body: <p>Most companies I have worked for start new projects with a templated folder structure. Windows will automatically flag empty folders (the icon shown in the file explorer is that of an empty folder) however, folders whose subfolders are also empty will not be flagged (their icon shows a folder containing files). This can create confusion and lead to mistakes during the early stages of a project as it would appear at a glance that some folders have had their content added when they really only contain empty subfolders.</p>
  
  <p>So my question is: </p>
  
  <blockquote>
    <p>How can I iterate over folders with empty subfolders and "flag" them via the use of a Batch file. </p>
  </blockquote>
  
  <p>The .bat file would need to search through subfolders to determine if a folder has any real content. If the folder does not have real content then the .bat file would need to flag it (flagging could be done with a change of its icon or filename). This would make it much easier to navigate new projects with large templated folder structures.</p>
  
  <p>I don't need a completed file, I would just like to know how it could be achieved. However, any tips or suggestions on how to achieve this functionality would be more than welcome!</p>
  
  <p>*Edit</p>
  
  <p>Just to clarify I will show an example:
  If I create an empty folder called 'Project' it will display with the <em>Empty Folder</em> icon. As shown Below:</p>
  
  <p><a href="https://i.stack.imgur.com/u9bFA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u9bFA.png" alt="enter image description here"></a></p>
  
  <p>Now I will add a new folder to my project folder called 'I am Empty':</p>
  
  <p><a href="https://i.stack.imgur.com/8KOdA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8KOdA.png" alt="enter image description here"></a></p>
  
  <p>The folder 'Project' no longer displays with the <em>Empty Folder</em> icon. It now uses the icon that shows it with content. As shown Below:</p>
  
  <p><a href="https://i.stack.imgur.com/EDIFZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EDIFZ.png" alt="enter image description here"></a></p>
  
  <p>What I want is a .bat file that will parse the contents of the 'Project' folder and determine that it only contains the 'I am Empty' folder, which is empty and "flag" that folder (to flag it we could change the icon of the 'Project' folder back to the <em>Empty Folder</em> icon, change the name or "gray it out"). As shown Below:</p>
  
  <p><a href="https://i.stack.imgur.com/meAln.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/meAln.png" alt="enter image description here"></a></p>