Tommy Mooney put Swindon into the lead after only 4 minutes with a close range header after Brian Howard's cross from a free kick on the edge of the box near the corner flag.
Swindon doubled their lead on 16 minutes when Brian Howard scored himself when from 25 yards out he saw the Stockport 'keeper off his line to hit the ball into the top right hand corner of the net.
On 18 minutes Swindon found themselves 3-0 up after Andy Nicholas who signed a new contract during the week scored from a header.
Stockport had been having most of the play during the first 20 minutes, so it was completely against the run of play for Swindon to be winning 3-0.
After 21 minutes Stockport got a goal back when Mark Robinson scored from 20 yards beating Rhys Evans who didn't move as the powerful shot hit the back of the net to put Stockport back in the game.
After the four goals in the first 21 minutes the game died down until half time, with both sides having half chances, but not coming close to scoring.
The second half started with a new referee in charge, although it wasn't clear why the referee from the first half was unable to continue.
On 50 minutes Stockport made sure that Swindon wouldn't be able to just sit back by bringing the scores back to 3-2 with a goal from Barlow.
Evans was foreced the make a number of good saves to stop Stockport from equalising, but it was Tommy Mooney who made sure that all 3 points would be heading back to the County Ground when deep into injury time he scored his 17th goal of the season after a pass from Sam Parkin.
Overall Swindon were luckly to win, despite scoring 4 goals Swindon didn't really look the better side, but did take their chances well. The win keeps Swindon in 4th on 51 points.
Swindon's next game in at home to Chesterfield next Saturday. In October Chesterfield beat Swindon 3-0.