Devante Cole and Kane Hemmings scored second-half goals as Barnsley beat York 2-0 in the first round of the Johnstone's Paint Trophy.
On-loan Manchester City striker Cole finished James Bree's cross at the back post just after the hour mark before substitute Hemmings claimed his first Tykes goal with a 25-yard strike 10 minutes from time.
Barnsley midfielder Conor Hourihane saw a 15-yard effort deflected narrowly wide in the 36th minute before Tykes winger Dale Jennings stung the palms of York goalkeeper Michael Ingham after the resulting corner was played short to him.
York's Keith Lowe should have claimed his third goal of the season six minutes before the break but the unmarked central defender volleyed wide from close range following a Luke Summerfield corner.
City forward Michael Coulson curled marginally wide of Barnsley's left-hand post six minutes after the restart before teenager Cole tapped home with 63 minutes played.
Striker Hemmings, a 65th-minute replacement for Sam Winnall, then smashed in off the right-hand upright to seal victory for the hosts.