Here is a simple technique to close all opened windows simultaneously with a click. For that, activate the last opened folder window in the directory structure.
Then keep the [Shift] key pressed and click the closing icon (with a cross in the title bar of this window). This will closes all the opened windows of the higher level folders simultaneously.
Note: This technique is needed, only if you enabled the option “Open each folder in its own window” from Tools menu – Folder option (XP), Organize – Folder and Search options (Windows 7) under the General tab. (via)