As Robert Craufurd's aide-de-camp during 1809 and 1810, Shaw was on the staff of the Light Division at the Coa and the Agueda, and, with William Campbell, prepared and edited the "Standing Orders of the Light Division" (printed in Home's "Précis of Modern Tactics", pp. 257–277). He was wounded at Almeida in 1810, but rejoined Craufurd at the end of 1811 and was with his chief at the siege of Ciudad Rodrigo in January 1812. At the great assault of 19 January, Shaw carried his general, mortally wounded, from the crest of the glacis and later conveyed Wellington's summons to surrender to the French governor. At Badajoz, now once more with the 43rd, he displayed, at the lesser breach, a gallantry which furnished his brother officer William Napier with the theme of one of his most glorious descriptive passages.