This is for a Mac that won't shut down. Launch Activity Monitor (or Process Viewer if you're running a pre-Panther OSX) and see if there are any active applications besides Activity Monitor ( items with icons next to the name), select them, and click Quit Process.
If an app won't quit by clicking Quit, click Force Quit. Then try shutting down again.
If that doesn't work start killing off system-managed programs ( items without icons ) . Be sure to quit only the programs your user account is running; don't quit anything identified as "root" or "nobody" in the User column- and whatever you do, don't quit any of the following : loginwindow, Window Server, ATSServer, or SystemUIServer, which make up the foundation of Mac OS.
Quit one process at a time, and then shut down after each kill until you find success!
I wish you luck!
p.s.If you install two of a single user licensed third-party application on different computers which are networked, this symptom may occur. If that is the case, a solution is to perform "Erase and Install" for both computers.
(p.s. contributed by *Fumiaki Kawashima* , Level 4)