Before the court is plaintiffs petition for a writ of mandamus compelling the commissioner of the Department of Motor Vehicles to withdraw DMV’s order revoking plaintiffs privilege to drive. The relevant facts are not in dispute.
On March 17, 1990, plaintiff was arrested in Hanover County for driving while intoxicated in violation of Va. Code § 18.2-266. He was convicted on September 13, 1990. This was plaintiffs third conviction for violating § 18.2-266, and in addition to imposing a fine and jail sentence, the district court, pursuant to Va. Code § 18.2-271, suspended plaintiffs operator’s license for three years. On November 26,1990, pursuant to Va. Code § 46.2-391(B), DMV issued an order revoking and suspending plaintiffs driving privileges for an indefinite period. It is plaintiffs position that DMV’s order was improper.
When plaintiff was arrested in March, 1990, Va. Code § 46.2-391(B) provided, in pertinent part, as follows:
Except as otherwise ordered pursuant to § 182-271 or § 182-271J, the Commissioner shall forthwith revoke and not thereafter reissue the driver’s license of any person adjudged to be a third offender within a period of ten years in violation of the provisions of § 18.2-266 ....
Emphasis added.
Effective July 1,1990, the statute was amended to delete the portion set out above in italics. Plaintiff argues that since he was arrested before the *73amendment became effective, and since the district court acted under § 18.2-271 to suspend his license prior to DMV’s order, suspension of his license had been “otherwise ordered pursuant to § 18.2-271,” and DMV was without authority to order an additional revocation or suspension in November. DMV disagrees with plaintiffs position, and argues that its revocation was proper both under the old statute and the amended statute. The court does not decide this issue.
In Richlands Medical Association v. Commonwealth, 230 Va. 384, 337 S.E.2d 737 (1985), the Supreme Court made clear the function of mandamus:
The function of a trial court in a mandamus proceeding is to “command and execute, and not to inquire and adjudicate.” Railroad Co. v. Fugate, 206 Va. 159, 164, 142 S.E.2d 546, 550 (1965). Indeed, a trial court exceeds its function and usurps the authority granted to a public official when it undertakes in a mandamus proceeding to review the discretion of the official. Broaddus v. Supervisors, 99 Va. 370, 372, 38 S.E. 177, 178 (1901).
“One of the marked characteristics of a proceeding by mandamus is that if the functionary whose conduct is complained of is by law to exercise any discretion, that discretion will not be controlled by a writ of mandamus; for that would be to transfer the discretion which the law commits to the functionary to the court which undertakes to award the writ” Id. at 372, 38 S.E. at 177-78; see Funeral Directors’ Ass'n v. Groth, 202 Va. 792, 797, 120 S.E.2d 467, 471 (1961) (mandamus will not lie to control manner in which public official exercises discretion).
Additionally, mandamus is applied prospectively only; it will not be granted to undo an act already done. Board of Supervisors v. Combs, 160 Va. 487, 498, 169 S.E. 589, 593 (1933); Thurston [v. Hudgins], 93 Va. [780] at 784, 20 S.E. [906] at 968.
Finally, the extraordinary remedy of mandamus may not be used as a substitute for an appeal. See Moon’s Administrator v. Wellford, Judge, 84 Va. 34, 4 S.E. 572 (1887). Mandamus “lies to compel, not to revise or correct action, however erroneous it may have been, and is not like a writ of error or appeal, [which is] a remedy for erroneous decisions.” Combs, 160 Va. at 498, 169 S.E. at 593.
230 Va. at 387.
*74Va. Code § 46.1-410 provides, in part:
Any person aggrieved by an order or act of the Commissioner requiring suspension or revocation of a license or registration under the provisions of this chapter is entitled to judicial review in accordance with the provisions of the Administrative Process Act (§ 9-6.14:1 et seq.).
Having failed to timely appeal his revocation as allowed by law, plaintiff cannot now challenge such revocation by mandamus. His petition will be denied.