In OS3.9, you could do it with ARexx, using
Code:
ADDRESS workbench
MENU WINDOW CURRENT INVOKE WINDOW.SHOW.ONLYICONS
MENU WINDOW CURRENT INVOKE ICONS.UNSNAPSHOT
MENU WINDOW CURRENT INVOKE WINDOW.CLEANUPBY.COLUMN
MENU WINDOW CURRENT INVOKE WINDOW.RESIZETOFIT
MENU WINDOW CURRENT INVOKE WINDOW.SNAPSHOT.WINDOW
This could be made recursive quite easily, but I don't have any functioning OS3.9 system at my disposal right now.