The Championship home team were booed off by their own fans after a dismal display at Loftus Road, where Nile Ranger opened the scoring seven minutes before half-time with his first goal for his new club.
The former Newcastle striker, signed on a free transfer this summer, finished at the far post following good work from the excellent Pritchard.
And Pritchard’s goal on the counter-attack capped a great night for manager Mark Cooper in his second match since taking permanent charge.
Rangers have now lost four of their last five home ties in the League Cup – three of them against lower division opposition – and they were on the back foot from the start.
Swindon settled quickly and Pritchard sent a free-kick over before Robins midfielder Massimo Luongo’s deflected shot went wide.
Harry Redknapp’s home side then enjoyed their own spell of first-half pressure, with Jermaine Jenas shooting wide and Alejandro Faurlin missing the target with a free-kick.
But Swindon remained a threat and went ahead when the R’s defence failed to deal with Pritchard’s ball in from the right and Ranger was able to net from close range.
The goal was scored while Swindon were down to 10 men after Alex Smith, who was eventually substituted, had hobbled off after picking up a knock.
With his team showing no sign of improvement after the break, Redknapp made a double substitution 11 minutes into the second half.
The recalled Samba Diakite – who was playing for the first time this year – and Bobby Zamora were replaced by Andy Johnson and Mo Shariff.
Young winger Shariff, making his QPR debut, quickly managed to make an impact.
He had an effort saved by goalkeeper Wes Foderingham and created an opening for Jenas, whose shot was charged down.
Shariff also threaded through a clever pass for Shaun Wright-Phillips only for the former England international to fire straight at Foderingham.
When Charlie Austin, playing against his former club, headed in at the far post with 12 minutes remaining Rangers thought they had equalised, but the striker was offside.
QPR were again left frustrated when Johnson was unable to connect with Yun-suk Young’s left-wing cross.
And they appealed in vain for a late penalty after Wright-Phillips went down under Nathan Thompson’s challenge.
To rub salt into their wounds, Pritchard doubled Swindon’s lead in the closing stages, when he squirmed away from Clint Hill before nudging the ball past goalkeeper Brian Murphy.