 Barrett signed for fellow Conference Premier team York City on a free transfer on 29 June 2009. He made his debut in a 2 – 1 defeat to Oxford on 8 August 2009, before scoring his first goal for the club with the opener in a 1 – 1 draw with Luton Town on 20 October with a shot in the bottom corner. He scored the opening goal in a 3 – 1 defeat to Premier League team Stoke City in the FA Cup third round on 2 January 2010, with a header from an Alex Lawless free kick. He picked up a hamstring injury during March 2010, missing one match before making his return in a 1 – 0 victory over Mansfield Town later that month. He played in both legs of York's play-off semi-final victory over Luton, which finished 2 – 0 on aggregate. He signed a new one-year contract with York on 13 May 2010. He started in the 2010 Conference Premier play-off Final at Wembley on 16 May, being substituted on 81 minutes, with York losing 3 – 1 to Oxford. He finished the 2009 – 10 season with 51 appearances and five goals for York.
