The officer so elected shall sign all bills of indictment, and conduct in court all criminal and other prosecutions in the name of the commonwealth, or when the state is a party, which arise in the county for which he is elected, and perform all the duties which now by law are to be performed by deputy attorney generals, and receive the same fees or emoluments of office: Provided, Said district attorney shall in no case whatever have authority to enter nolle prosequi in any criminal case, either before or after bill found, or to discharge a prisoner from custody, without first having obtained the approbation of the court in writing.
16 P.S. § 9952