A compound of formula IV: or a pharmaceutically acceptable salt thereof wherein, R1 is (a) Cl, (b) Br, (c) CN, (d) NO2, or (e) F; R2, R3 and R4 are independently selected from: (a) H, (b) halo, (c) aryl, (d) S(O)mR6, (e) (C═O)R6, (f) (C═O)OR9, (g) cyano, (h) het, wherein said het is bound via a carbon atom, (i) OR10, (j) Ohet, (k) NR7R8 (1) SR10, (m) Shet, (n) NHCOR12, (o) NHSO2R12, or (p) C1-7alkyl which may be partially unsaturated and optionally substituted by one or more substituents of the group R11, OR13, SR10, SR13, NR7R8, halo, (C═O)C1-7alkyl, or SOmR9; R6 is (a) C1-7alkyl, (b) NR7R8, (c) aryl, or (d) het, wherein said het is bound via a carbon atom; R7 and R8 are independently (a) H, (b) aryl, (c) C1-7alkyl which may be partially unsaturated and is optionally substituted by one or more substituents selected from NR10R10, R11, SOmR9, CONR10R10, or halo, or, (d) R7 and R8 together with the nitrogen to which they are attached form a het; R9 is (a) aryl, (b) het, (c) C3-8cycloalkyl, (d) methyl, or (e) C2-7alkyl which may be partially unsaturated and is optionally substituted by one or more substituents selected from NR10R10, R11, SH, CONR10R10, or halo; R10 is (a) H, (b) methyl, or (b) C2-7alkyl optionally substituted by OH; R11 is (a) OR10, (b) Ohet, (c) Oaryl, (d) CO2R10, (e) het, (f) aryl, or (g) CN; R12 is (a) H, (b) het, (c) aryl, (d) C3-8cycloalkyl, (e) methyl, or (f) C2-7alkyl optionally substituted by NR7R8 or R11; R13 is (a) (P═O)(OR14)2, (b) CO(CH2)nCON(CH3)-(CH2)nSO3?M+, (c) an amino acid, (d) C(═O)aryl, or (e) C(═O)C1-7alkyl optionally substituted by NR7R8, aryl, het, CO2H, or O(CH2)nCO2R14; R14 is (a) H, or (b) C1-7alkyl; each n is independently 1, 2, 3, 4 or 5; each m is independently 0, 1, or 2; M is sodium, potassium, or lithium; aryl is a phenyl radical or an ortho-fused bicyclic carbocyclic radical wherein at least one ring is aromatic; wherein any aryl is optionally substituted with one or more substituents selected from the group consisting of halo, OH, cyano, CO2R14, CF3, C1-6alkoxy, and C1-6alkyl which may be further substituted by one to three SR14, NR14R14, OR14, or CO2R14 groups; het is a four- (4), five- (5), six- (6), or seven- (7) membered saturated or unsaturated heterocyclic ring having 1, 2, or 3 heteroatoms selected from the group consisting of oxygen, sulfur, and nitrogen, which is optionally fused to a benzene ring, or any bicyclic heterocycle group; wherein any het is optionally substituted with one or more substituents selected from the group consisting of halo, OH, cyano, phenyl, CO2R14, CF3, C1-6alkoxy, oxo, oxime, and C1-6 alkyl which may be further substituted by one to three SR14, NR14R14, OR14, or CO2R14 groups; is provided. The compounds are particularly effective in the treatment or prevention of herpesviruses. Certain novel 4-hydroxy-1,8-naphthyridine-3-carboxyamides. The compounds are effective in the treatment or prevention of viral infections, particularly viral infections caused by herpes simplex viruses types 1 and 2, human herpes viruses types 6, 7 and 8, varicello zoster viruses, human cytomegaloviruses and Epstein-Barr viruses.