Quote Originally Posted by alanrockwood View Post
The priority for payout in a bankruptcy runs roughly like this. The government gets paid first (taxes). Then wages to workers get paid, including any back wages owed. Then various forms of secured debt, i.e. debt backed by collateral, then unsecured debt. At the very tail end of the priority list come the shareholders. If the creditors don't get paid what they are owed then the shareholders lose ownership of the company. Their shares are cancelled and become worthless. If the company emerges as an operating company it does so under new ownership, usually being owned by the former creditors as partial compensation for not having been paid all the money they were owed.
You missed the fees for the trustee in bankruptcy - they usually are near the top of the list.

And at the risk of being too technical, in some cases shareholders hold "preferred" shares, which are actually more like debt instruments, and are therefore given a portion of what is available to unsecured creditors (if anything).

It is true that control is essentially in the hands of the bankruptcy court. If, however, the right person or entity (think deep pockets and a history of business success) took over a controlling shareholding, it might very well affect how the bankruptcy proceeds.