In the battlefield, this might not always be possible or efficient, which is why DARPA has recently revealed that they are helping the US military develop a vaccine that can adapt itself to new viruses, which will hopefully be able to keep itself one step ahead of viruses which can mutate into new strains that are resistant to the current vaccine.
Dubbed INTERfering and Co-Evolving Prevention and Therapy (INTERCEPT), this method will see it harness the potential of Therapeutic Interfering Particles (TIPs) which are said to be similar to viruses, except that they do not affect the host’s cells. However when a virus does affect the cell, TIPs will then activate and then copies the genomes of the virus and will compete with the virus for protein shells.
Basically the idea is to help water down the virus to make it as harmless as possible. Now before you get too excited, there is obviously a very long road ahead in terms of developing TIP candidates, but it is a good start nonetheless.