If an action is commenced by direction of the court, the costs shall be taxed and disposed of as in criminal cases; provided that no allowance shall be made in such case for the payment of attorney fees.