The use of hydroxybenzoic acid ester and analogues for the manufacture of a medicament for the prevention and treatment of viruses infection, especially human and animal HBV, HPV and HSVinfection is provided, wherein virus infection comprises HB, herpes simplex, condyloma acuminatum, vaginitis, cervicitis, and cervical erosion. Otherwise, the various kind of medicament and personal nursing product which are prepared by hydroxybenzoic acid ester and analogues and pharmaceutical adjuvant are provided.