James Collins' early strike put the visitors ahead before a Liam Lawrence own goal restored parity on the half-hour mark.
But Barnett's 32nd-minute effort consigned Rovers to a third straight defeat at the hands of League One opposition in round one of the competition.
Rovers handed a debut to 17-year-old Ryan Nyambe, but his poor pass led to a ninth-minute opening goal. Abu Ogogo latched onto the ball and, although his shot was saved, Collins fired in the rebound.
Premier League
Opinion: Havertz can take league by storm after debut season filled with challenges
Blackburn goalkeeper Jason Steele was lucky not to concede a penalty when he appeared to clip Ogogo, but the hosts were level on the half-hour as Nyambe's cross was diverted into his own net by Lawrence.
Parity lasted for only two minutes, though, as a clearance fell to Barnett 20 yards out and he drilled emphatically into the bottom-right corner.
Shrewsbury goalkeeper Jayson Leutwiler acrobatically palmed a 30-yard Ben Marshall effort behind on the stroke of half-time, while early in the second period Collins blazed over from close range after the ball had fallen kindly to him.
Blackburn substitute Fode Koita then saw a close-range header tipped over and went even closer in the final minute when his header drifted agonisingly wide as Rovers bowed out.
Andriy Shevchenko leaves his role as head coach of Ukraine
£100m Grealish transfer puts Man City's Kane pursuit under threat - Paper Round