The Reds were poor in the first half but took the lead on 63 minutes through Cole on his first career start. Substitute Hemmings doubled the lead with the minutes left as his first goal for the club came with a screamer from 25 yards.
Danny Wilson made three changes to the side that drew 1-1 at Yeovil in the league three days earlier as James Bree, Cole and Dale Jennings came in for Luke Berry, Leroy Lita and Keith Treacy.
The Reds were poor in the first half and failed to attack until the 36th minute when Conor Hourihane's 15-yard shot was deflected just wide.
York had several opportunities as Luke Summerfield saw one long-range effort saved by Adam Davies and another fly over and he also whipped in two corners which Keith Lowe should have turned in but the centre-back put both efforts wide.
The Reds looked more urgent at the start of the second half and took the lead when 16-year-old Bree combined with Reece Brown on the right wing before whipping in a fine cross which Cole turned in.
It was 2-0 17 minutes later when Hemmings picked up the ball 25 yards out and sashed his first goal in English football into the top right corner off the post.
Most read sport stories