Acyclovir injection is used to treat first-time or repeat outbreaks of herpes simplex (a herpes virus infection of the skin and mucus membranes) and to treat herpes zoster (shingles; a rash that can occur in people who have had chickenpox in the past) in people with weak immune systems. It is also used to treat first-time genital herpes outbreaks (a herpes virus infection that causes sores to form around the genitals and rectum from time to time) in people with normal immune systems. Acyclovir injection is used to treat herpes simplex encephalitis (brain infection with swelling caused by the herpes virus) and herpes infections in newborn infants. Acyclovir injection is in a class of antiviral medications called synthetic nucleoside analogues. It works by stopping the spread of the herpes virus in the body.