The 17-strong group from Whitchurch High School in Cardiff raised eyebrows when they were seen in the morning striding around the school in borrowed skirts.
Protester Tyrone Evelyn, 15, said the group, from Whitchurch High School in Cardiff, would continue campaigning for a change.
"It's just appropriate for the weather, we don't want to be hot and bothered. Over the last few days I've had a few headaches and skin irritations because I've been too hot," he was quoted by The Mirror as saying.
Tyrone and his friends wore trousers to school with skirts stowed in their bags after they suspected some teachers had got wind of their protest, which they planned on Facebook.
More From This Section
They then nipped into the loos and changed, before taking to the school corridors chanting, "we want to wear shorts".
Tyrone's mother Andrea John, 51, said she would be happy to buy school shorts, adding: "It should be optional to wear three-quarter length shorts. It would cost exactly the same as if they wore trousers."
Train company Arriva has since capitulated and changed its policy to say all their drivers can wear trousers, shorts or skirts.
But it seems the protest was short-lived and came to an abrupt end when the boys were marched into the headmaster's office.
Despite rumours that the pupils had been sent home, headteacher Huw Jones-Williams said no-one had been punished.
"We had a conversation with some boys this morning and they have worn trousers," he said.
Britain is experiencing its first prolonged heatwave since 2006, with six consecutive days of temperatures above 30 degrees Celcius.
Ambulance services across England have reported an increase in call-outs since the hot weather began.