The quick and easy response is that the word "kill" in the quoted commandment is more properly translated "murder" and thus would not apply to actions taken against an enemy in time of war. But this doesn't really go to the heart of the problem; isn't war itself a sin?

Sin is not something we do so much as something we are in. We are broken people, living in a broken world. Terrible things happen in it that demand a response. They may not be the kind of responses we would like; we may in fact end up doing things for which, I think, we should justifiably ask forgiveness of our God. But the alternative (leaving innocent civilians undefended against a marauding enemy, for example) may be to fall deeper into sin. These are the types of choices we must make, and of all the promises in the Bible, nowhere does it say that these choices will be easy.

Anyone who thinks at all about Christianity, whether they believe or not, will inevitably ask if one thing or another will send people to Hell. As a Christian I can only answer that in Jesus Christ all sins are forgiven, and we are all saved through His sacrifice on the cross. Beyond that we do the best we can to let God guide us as we live our lives, and ask forgiveness when we stumble on the path.