EXHIBIT 23.1 CONSENT OF INDEPENDENT AUDITORS We consent to the reference to our firm under the caption "Experts" in the Registration Statement (Form S-4) and related Prospectus of United Bankshares, Inc. for the registration of up to 271,000 shares of its common stock and to the incorporation by reference therein of our report dated February 10, 1995, with respect to the consolidated financial statements of United Bankshares, Inc. incorporated by reference in its Annual Report (Form 10-K) for the year ended December 31,1994, filed with the Securites and Exchange Commission. /s/ Ernst & Young LLP Charleston, West Virginia July 3, 1995