
576 S.E.2d 458 (2003)
265 Va. 313
In re COMMONWEALTH'S ATTORNEY FOR the CITY OF ROANOKE.
Record Nos. 021441, 021442.
Supreme Court of Virginia.
February 28, 2003.
*459 Donald S. Caldwell, Roanoke, for petitioner.
John D. McChesney (Edward J. McNelis, on brief), for respondent.
Present: HASSELL, C.J., LACY, KEENAN, KOONTZ, KINSER, and LEMONS, JJ., and CARRICO,[1] S.J.
Opinion by Justice CYNTHIA D. KINSER.
These cases are before the Court on two petitions for writs of prohibition and/or mandamus filed by the petitioner, Donald S. Caldwell, Commonwealth's Attorney for the City of Roanoke, and directed to the Honorable James R. Swanson, Judge of the Circuit Court for the City of Roanoke. The Commonwealth's Attorney is proceeding under this Court's original jurisdiction pursuant to Article VI, § 1 of the Constitution of Virginia and Code § 17.1-309.
This Court consolidated the petitions for purposes of argument and opinion. The underlying facts and proceedings of each case are similar and are not disputed. Because *460 neither prohibition nor mandamus lies in the context presented, we will dismiss both petitions.

I. FACTS AND PROCEEDINGS

A. RECORD NO. 021441
Kian Keith Putbrese was arrested for stealing a television valued in excess of $200 from a retail department store and charged with grand larceny in violation of Code § 18.2-95. Putbrese waived a preliminary hearing and was subsequently indicted for grand larceny.
On February 13, 2002, Putbrese entered a guilty plea to the charge. After hearing a summary of the evidence, Judge Swanson withheld an adjudication of guilt and took acceptance of the guilty plea under advisement pending receipt of a pre-sentence report.
After review of the pre-sentence report at the subsequent sentencing hearing, Judge Swanson continued to take the finding of guilt under advisement. But, he placed Putbrese on supervised probation for a period of three years and, as conditions of probation, required Putbrese to: (1) continue in counseling and therapy; (2) perform 200 hours of community service; (3) seek and maintain full-time employment; (4) remain drug and alcohol free; (5) be of good behavior; and (6) enter into and complete any substance abuse treatment required by the probation officer.
The Commonwealth's Attorney then moved the circuit court to reconsider its decision taking the finding of guilt under advisement and to enter an order finding Putbrese guilty according to his plea and the evidence. After considering arguments, Judge Swanson denied the motion.
The Commonwealth's Attorney subsequently filed the petition for a writ of prohibition and/or mandamus presently before us. He asks this Court: (1) to prohibit Judge Swanson "from continuing the findings of guilt under advisement;" (2) to order him to vacate the order which "`withholds [his] findings as to the sufficiency of evidence and takes ... under advisement' the finding of guilt therein, but nonetheless adjudicates a `punishment' including supervised probation, community service, and continued counseling;" and (3) to order Judge Swanson "to proceed to enter a judgment of guilt and, thereafter, to proceed to sentencing in accordance with the statutory and case laws of the Commonwealth."

B. RECORD NO. 021442
Alison M. Boyd was arrested for stealing clothing valued at more than $200 from a retail department store. Boyd waived a preliminary hearing, and a grand jury subsequently indicted her for grand larceny in violation of Code § 18.2-95.
On February 4, 2002, Boyd pled guilty to the charge. After hearing a summary of the evidence, the circuit court "found that the plea was knowingly and intelligently entered and supported by the evidence and ... that the evidence is sufficient to find the defendant guilty." However, the court withheld a finding of guilt and took the matter under advisement until a pre-sentence report could be prepared.
After receiving the pre-sentence report at the subsequent sentencing hearing, Judge Swanson withheld a finding as to the sufficiency of evidence and took that matter under advisement.[2] However, Judge Swanson placed Boyd under the supervision of a probation officer upon the conditions that Boyd: (1) be of good behavior for a minimum period of 12 months; (2) serve one day in jail; (3) complete 200 hours of community service within 12 months; and (4) continue in counseling and follow all treatment recommendations. Judge Swanson also set the case for "review" on October 9, 2002.
The Commonwealth's Attorney then moved the court to reconsider its decision and enter a judgment finding Boyd guilty according to her plea and the evidence. Judge Swanson denied the motion.
The Commonwealth's Attorney subsequently filed the petition for a writ of prohibition and/or mandamus that is pending *461 before us. In that petition, the Commonwealth's Attorney asks for the same relief that he requested in the Putbrese matter.

II. ANALYSIS

A. WRIT OF PROHIBITON
The law concerning a writ of prohibition is well-established. Oxenham v. J.S.M., 256 Va. 180, 183, 501 S.E.2d 765, 767 (1998). "A writ of prohibition is an extraordinary remedy employed `to redress the grievance growing out of an encroachment of jurisdiction.'" Elliott v. Great Atlantic Management Co., Inc., 236 Va. 334, 338, 374 S.E.2d 27, 29 (1988) (quoting James v. Stokes, 77 Va. 225, 229 (1883)). The writ does not lie to correct error but only to prevent exercise of the jurisdiction of the court by the judge to whom it is directed when the judge either has no jurisdiction or is exceeding his/her jurisdiction. In re Department of Corrections, 222 Va. 454, 461, 281 S.E.2d 857, 861 (1981); Grief v. Kegley, 115 Va. 552, 557, 79 S.E. 1062, 1064 (1913).
Jurisdiction is "the power to adjudicate a case upon the merits and dispose of it as justice may require." County School Bd. of Tazewell County v. Snead, 198 Va. 100, 104-05, 92 S.E.2d 497, 501 (1956) (quoting Southern Sand and Gravel Co., Inc. v. Massaponax Sand and Gravel Corp., 145 Va. 317, 331-32, 133 S.E. 812, 816 (1926) (Burks, J., concurring)). Prohibition will not lie "[i]f the court or judge has jurisdiction to enter any order in the proceeding sought to be prohibited." Grief, 115 Va. at 557, 79 S.E. at 1064. Thus, a writ of prohibition will not lie against Judge Swanson if he had jurisdiction to adjudicate and to enter any order in the proceedings involving the felony charges against Putbrese and Boyd. See Oxenham, 256 Va. at 184, 501 S.E.2d at 767.
Circuit courts "have original jurisdiction of all indictments for felonies and of presentments, informations and indictments for misdemeanors." Code § 17.1-513. Here, both defendants were charged with grand larceny, a felony carrying a maximum penalty of not more than 20 years in a state correctional facility. Code § 18.2-95. Accordingly, Judge Swanson had jurisdiction to adjudicate both criminal cases and to enter orders therein. Therefore, a writ of prohibition does not lie, and we will dismiss both petitions. Cf. Department of Corrections, 222 Va. at 463, 466, 281 S.E.2d at 862, 864 (awarding writ prohibiting trial judge from entering any order on motions to suspend balance of sentences of two defendants because court no longer had jurisdiction to act on the motions).

B. WRIT OF MANDAMUS
"Mandamus is an extraordinary remedy that may be used `to compel performance of a purely ministerial duty, but it does not lie to compel the performance of a discretionary duty.'" Ancient Art Tattoo Studio, Ltd. v. City of Virginia Beach, 263 Va. 593, 597, 561 S.E.2d 690, 692 (2002) (quoting Board of County Supervisors v. Hylton Enters., Inc., 216 Va. 582, 584, 221 S.E.2d 534, 536 (1976)). "A ministerial act is `one which a person performs in a given state of facts and prescribed manner in obedience to the mandate of legal authority without regard to, or the exercise of, his own judgment upon the propriety of the act being done.'" Richlands Medical Ass'n. v. Commonwealth of Virginia, 230 Va. 384, 386, 337 S.E.2d 737, 739 (1985) (quoting Dovel v. Bertram, 184 Va. 19, 22, 34 S.E.2d 369, 370 (1945)). However, when the act to be performed involves the exercise of judgment or discretion on the part of the court or judge, it becomes a judicial act and mandamus will not lie. Dovel, 184 Va. at 22, 34 S.E.2d at 370. As we stated in Page v. Clopton, 71 Va. (30 Gratt.) 415, 418 (1878):
[Mandamus] may be appropriately used and is often used to compel courts to act where they refuse to act and ought to act, but not to direct and control the judicial discretion to be exercised in the performance of the act to be done; to compel courts to hear and decide where they have jurisdiction, but not to pre-determine the decision to be made; to require them to proceed to judgment, but not to fix and prescribe the judgment to be rendered.
Here, the Commonwealth's Attorney asks us to direct Judge Swanson to enter *462 judgments of guilt in both criminal cases. The Commonwealth's Attorney argues that, once the defendants entered guilty pleas, the circuit court had "nothing to do" except enter judgment and fix punishment. According to the Commonwealth's Attorney, there is no authority, statutory or otherwise, allowing a circuit court to defer or take under advisement a finding of guilt after a defendant pleads guilty to the felony of grand larceny. Recognizing that some criminal statutes affirmatively authorize a trial court to defer a finding of guilt even when the evidence presented establishes a defendant's guilt, the Commonwealth's Attorney asserts that Code § 18.2-95, under which both Putbrese and Boyd were charged, contains no such provision.[3] Finally, the Commonwealth's Attorney claims that Judge Swanson's decision to defer findings of guilt in these two cases "creates an injustice for the law-abiding citizens of the Commonwealth, fails to provide for a finality of litigation, and undermines the public confidence in the neutrality of the judiciary."
We do not reach the merits of these arguments because a writ of mandamus does not lie in the context presented here. The Commonwealth's Attorney asks us to control Judge Swanson's exercise of judicial discretion by prescribing the precise judgment to be entered, a judgment of guilt. However, a judgment is a court's determination of the rights of the parties upon matters submitted to it in a proceeding. Rollins v. Bazile, 205 Va. 613, 617, 139 S.E.2d 114, 117 (1964). "The rendition of a judgment is the judicial act of the court." Id. Requiring a court or judge to enter a certain judgment unquestionably infringes upon the exercise of judicial discretion. Mandamus does not lie "to fix and prescribe the judgment to be rendered." Page, 71 Va. at 418. Thus, we will dismiss the petitions for a writ of mandamus.
However, the Commonwealth's Attorney points out that this Court has previously granted a writ of mandamus when a trial court withheld imposition of a mandatory sentence upon a defendant's conviction for use of a firearm in the commission of a felony. In re Commonwealth's Attorney for Chesterfield County, 229 Va. 159, 163, 326 S.E.2d 695, 698 (1985). There, we construed the statutory language stating that the sentence "shall not be suspended" to mean that the trial judge could not either delay imposition of the mandatory sentence or stay its execution. Id. However, that decision is not dispositive here because we specifically noted that the respondent there did not challenge mandamus procedurally but merely argued that the requested relief should be denied. Id. at 161 n. 2, 326 S.E.2d at 696 n. 2.

CONCLUSION
For the reasons stated, the petitions for a writ of prohibition and/or mandamus are dismissed.[4]
Record No. 021441Dismissed.
Record No. 021442Dismissed.
NOTES
[1]  Chief Justice Carrico presided and participated in the hearing and decision of this case prior to the effective date of his retirement on January 31, 2003.
[2]  That order was inconsistent with the prior one where a different judge of the circuit court found the evidence sufficient to find Boyd guilty but withheld the finding of guilt.
[3]  In the petitions for a writ of prohibition and/or mandamus, the Commonwealth's Attorney did not raise the issue whether a court may order probation in the absence of a conviction. See Code § 19.2-303 (court may order probation "[a]fter conviction"). Instead, the Commonwealth's Attorney complains only about Judge Swanson's decision to take the finding of guilt under advisement in both criminal cases. However, the Commonwealth's Attorney correctly notes that certain criminal statutes do contain explicit authority for a trial court to place a defendant on probation without first entering a judgment of guilt. See, e.g., Code §§ 18.2-251 (possession of controlled substances); -57.3 (assault and battery against a family member); -61(D) (marital rape); -67.1(D) (marital forcible sodomy); -67.2(D) (marital object sexual penetration); -67.2:1(C)(marital sexual assault); -138.1(B) (malicious damage to public or private facilities); and Code § 19.2-303.2 (property crimes constituting misdemeanors).
[4]  We also note that neither prohibition nor mandamus will lie to undo acts already done. In re Department of Corrections, 222 Va. at 461, 281 S.E.2d at 861 (prohibition); Richlands Medical, 230 Va. at 387, 337 S.E.2d at 740 (mandamus). The acts about which the Commonwealth's Attorney complains, taking the findings of guilt under advisement, have already taken place.
