Thanks for your question and concern. For your information, let me make it clear that most of the urinary tract infections are caused by bacteria and not virus. Medications used to treat bacterial infection are not suitable to treat virus infections like genital herpes. Antiviral medications are used to treat viral infections. Anyway, there is no support for prevention of viral infections like HSV, possible using antiviral medication. They can simply offer relief from symptoms of acute viral infections. Moreover, HSV infection will stay lifelong in human body after getting infected for once. So, the only way to prevent infection is to abstain from sex with partners having genital herpes infection or by using barrier methods for sex, like condoms. But they are not found to be 100% safe. Hope I answered your query well. Take care.