Windows Folder Magic

Windows Folder Magic is a small command-line tool that allows for automatic setting folder icons based on if the folder (and it's subfolders) are empty or not. Empty here means that there are actually files and not only folders. This is helpful if you have repeating standard folder structures where only a few folders actually contain content. The tool is written in Java and the download also contains a console wrapper executable. You can specify separate icons for non-empty and for empty folders. 

This is the command-line for all operating systems:

java -jar WindowsFolderMagic
-setDefaultIconFile:C:\example\icons\default-folder.ico -setDefaultIconIndex:0
-setEmptyIconFile:%SystemRoot%\system32\SHELL32.dll  -setEmptyIconIndex:215
-updateFolderIcon:C:\example\folder

This is the command-line for Windows:

And these are the resulting folder icons for the example above. Non-empty folders now have a disk icon: