The operation in South Waziristan, the main Taliban and Al Qaeda sanctuary in Pakistan, has sparked a wave of retaliatory attacks that have killed about 300 civilians and security forces in the past month.
The shooting in Islamabad was the third such attack in about two weeks.
The militants hope the attacks will weaken the army's resolve as it pushes deeper into the isolated, mountainous region near the Afghan border. But the army pressed ahead Friday, entering Makeen, the hometown of former Pakistani Taliban leader Baitullah Mehsud, who was killed in a suspected U.S. missile strike in August.
Troops razed Mehsud's house, an act of vengeance for the hundreds of people the Pakistani Taliban has killed in the country.
In Islamabad, assailants opened fire on an army brigadier and a soldier as the two drove away from the officer's home, said police official Khan Khurshid Khan. The gunmen sped away after the attack, he said.
Hospital official Arshad Khokhar said the brigadier and the soldier were in stable condition. A brigadier is equivalent to a brigadier general in the U.S. Army.
It was unclear if the officer was involved in the South Waziristan offensive, which was launched in mid-October.
On Oct. 22, gunmen on a motorcycle shot and killed a brigadier and a soldier riding in an army jeep in what was believed to be the first assassination of an army officer in the capital.
Less than a week later, gunmen attacked another brigadier as he was driving to a bank with his mother, but they escaped unharmed.
No group has claimed responsibility for the attacks, but suspicion fell on the Pakistani Taliban, which has declared war on the government for alleged being un-Islamic and supporting the U.S. war on terror.