I can't remember ever using attack command. Always give orders to individual units to fire at tanks, inf or what I perceive as danger.
If there is no units left, tanks will fire automatically on buildings
p.s. issuing attack command or move command is basically the same thing.
(been playing COH for 6-7 years, can't remember ever using it, nor does attack button exist. lol
When having a unit selected, pressing A and left clicking somewhere on the battlefield issues an Attack Move, which means your units will start moving there, and on the way when spotting an enemy, stop, infantry usually then try to find cover, and start shooting back at the enemy, until the enemy is hopefully destroyed, then they proceed to move on to your designated point. This I mostly use when I know the enemy is already defeated yet they have their base left and I need to destroy it.
When issuing a move order though, (like simply right clicking somewhere on the map) your units will move there, while firing on any enemies they spot, however they will not stop to make sure they destroy them first.
However, attack move order aside, even when issuing individual attack orders on units in the enemy base, whenever the enemy targeted is destroyed, your units might likely (might likely based on how far your units are from the enemy HQ) start attacking the (now destroyed) enemy HQ if you weren't paying full attention to the second the enemy got destroyed and your ready to issue the next target.