The petitioner in the instant case seeks a writ of mandamus to compel a circuit judge to hold hearings on various motions pending in a habeas corpus action filed by the petitioner, or in the alternative a writ of habeas corpus compelling his release from incarceration. After reviewing the record and briefs presented by the parties, we deny the requested writs.
I.
The petitioner in the instant case, Terry A. Gill, is incarcerated in the state penitentiary at Mount Olive as a result of his conviction for numerous sexual offenses upon a minor. This Court .reviewed the petitioner’s trial on appeal, and subsequently affirmed his conviction. See State v. Gill, 187 W.Va. 136, 416 S.E.2d 253 (1992). Several years later, the petitioner filed a petition for a writ of habeas corpus with this Court, and in an order dated May 20, 1998, we directed the judge of the circuit court who oversaw the petitioner’s conviction, respondent George W. Hill, Jr., to examine the petitioner’s contentions.
The briefs and submissions of the parties suggest that the petitioner, acting on his own, has filed many motions and other documents with the circuit court. Since June 1998, two different attorneys have been appointed at different times to represent the petitioner, but the petitioner continued to file pro se motions. Both attorneys later withdrew their representation, citing conflicts with the petitioner. Since January 2000, the petitioner has been acting without counsel.
Healings were conducted by the circuit court on January 14, 2000 and August 3, 2000. It appears that the petitioner was present at both hearings. At these hearings the circuit court required the State to produce copies of various documents to the petitioner. The circuit court also granted the petitioner’s request for the assistance of a private investigator, and requested that the State arrange for payment of the private investigator’s expenses through the Public Defender’s Corporation.
At the January 14, 2000 hearing, the State contends that it moved the circuit court to schedule the matter for a final hearing. The petitioner allegedly objected, and the circuit court continued the case until such time as the petitioner set the matter for a final hearing. The State again moved the circuit court at the August 3, 2000 hearing to set a final hearing, and over the petitioner’s objections, the circuit court scheduled a full evidentiary hearing for December 15, 2000.
On November 29, 2000, the petitioner sought a continuance of the December 15, 2000 hearing, which the circuit court granted. The petitioner subsequently sought leave to amend his petition for a writ of habeas corpus, and a hearing on the amendment was scheduled for January 12, 2001. The State notified the petitioner that it did not object to the petitioner’s amendment, and prepared an agreed order for the circuit court. The petitioner objected to the agreed order, and apparently sought, and received, a continuance of the January 12 hearing.
The State asserts that on January 23, 2001, the petitioner filed a motion to compel the prosecutor to reveal the address of the attorney who defended the petitioner in his underlying felony trial, and an “emergency motion for discharge of sentence for ex parte conspiracy by prosecutors.” These motions were apparently not scheduled for any hearings with the circuit court.
On February 27, 2001, the petitioner filed the instant petition with this Court. While it is difficult to decipher the exact basis for the relief sought by the petitioner, it appears that he seeks a writ of mandamus to compel the circuit court to hold a hearing on the various motions filed by the petitioner with the circuit court. In the alternative, it appears that the petitioner seeks a writ of habeas corpus to compel his immediate release from custody because of alleged prose-cutorial misconduct involving the petitioner’s defense trial attorney.
*101The Court issued a rule to show cause why the requested writs should not be granted on May 24, 2001.
II.
We stated in State ex rel. Billings v. City of Point Pleasant, 194 W.Va. 301, 303, 460 S.E.2d 436, 438 (1995) that the traditional use of mandamus has been “to confine an administrative agency or an inferior court to a lawful exercise of its prescribed jurisdiction or ‘to compel it to exercise its authority when it is its duty to do so.’ ” To ensure that writs of mandamus are used only in the most extraordinary of situations, we have established three factors that must be met before relief will be granted. In Syllabus Point 2 of State ex rel. Kucera v. City of Wheeling, 153 W.Va. 538, 170 S.E.2d 367 (1969), we stated:
A writ of mandamus will not issue unless three elements coexist — (1) a clear legal right in the petitioner to the relief sought;
(2) a legal duty on the part of respondent to do the thing which the petitioner seeks to compel; and (3) the absence of another adequate remedy.
After examining the briefs of the parties, the documents attached thereto, and all other matters of record with this Court, we find that the petitioner has not demonstrated a clear right to a writ of mandamus. The petitioner has not demonstrated the existence of a clear right to hearings on the numerous motions he has filed with the circuit court, as hearings on motions in civil actions are largely held at the discretion of the circuit court. See, e.g., West Virginia Trial Court Rules Rule 22.03 [1999] (“The court may require or permit hearings on motions ...” [emphasis added]). Further, we agree that a circuit court has an obligation to ensure — with or without hearings, as the court deems necessary — the prompt and orderly administration of matters before the court (including the timely consideration of and ruling upon all motions filed by a party), and generally has a duty to schedule the petitioner’s case only for a final “omnibus habeas corpus hearing.” See Losh v. McKenzie, 166 W.Va. 762, 277 S.E.2d 606 (1981). However, it appears that the petitioner' himself has frustrated this process by seeking continuances to avoid such hearings. On this record, we perceive the existence of another, more adequate, remedy: the petitioner may directly request a final hearing from the circuit court. We therefore refuse to issue a writ of mandamus.
The writ of habeas corpus “lies to test the legality of the restraint under which a person is detained.” Tasker v. Griffith, 160 W.Va. 739, 742, 238 S.E.2d 229, 231 (1977). In Syllabus Point 1 of State ex rel. Vandal v. Adams, 145 W.Va. 566, 115 S.E.2d 489 (1960), we held that “A writ of habeas corpus ad subjiciendum will lie to effect the release of one imprisoned in the State Penitentiary without authority of law.”
We find that the petitioner has not demonstrated that he is being held without authority of law. It appears that the circuit court has attempted to offer the petitioner due process, but the petitioner has repeatedly sought continuances of scheduled hearings. On the existing record before this Court, the petitioner has been afforded due process and an opportunity to raise questions before the circuit court — including the petitioner’s allegations of prosecutorial misconduct — and is therefore not being held without authority of law. Accordingly, we refuse to issue a writ of habeas corpus.
III.
The petition for writs of mandamus and habeas corpus is denied.
Writs Denied.
Justice ALBRIGHT, deeming himself disqualified, did not participate in the Decision of the Court. Judge ROBERT A. BURNSIDE, Jr., sitting by temporary assignment.