Antibiotics work by changing or altering any important metabolic pathway in bacteria. Different types of antibiotics act on different pathways to kill or inhibit bacterial growth. Viruses on the other hand do not possess metabolic pathways on which antibiotics can act. These antibiotics thus are of no use for viral infection.