Flanagan got the first and last of the Bulldog tries triggering an 80-metre breakaway within the first two minutes and diving over the line from the play the ball when the move broke down just short.
He also got the last try of the game as Batley applied their forward pressure and the hooker was on hand to wrestle his way over.
Speedy full-back Greenwood made his mark after Batley had established superiority over the visitors with cracking touchdowns from Tom Hemingway, wingman Johnny Campbell and centre Alex Bretherton.
Profiting from the sizzling runs of stand-off Ben Black, the full-back was on hand to collect a chip through and touch down and two minutes later was again on hand to take a defence-splitting pass from the stand-off to score his second try.
The value of all the touchdowns was increased magnificently by the skill of scrum-half Tom Hemingway who added seven conversions from seven attempts from all over the park as well as touching down for a try just before the break.
York had looked as though they would make a real game of it when quick handling from Danny Nicklas and Tom Carr sent Jim Arundel over for a try in the corner with only eight minutes gone in the game.
But conceding numerous penalties, sustaining a string of injuries and seeing Simon Brown sin binned for questioning the referee’s decision just before the break proved devastating.
Batley Bulldogs: Greenwood; Campbell, Walton, Bretherton, Johnson; Black, Hemingway; Smith, Flanagan, Rowe, Applegarth, Davies, Lindsay. Substitutes: Mennnell, Hirst, Fleming, Scott.
York City Knights: Carr; Dent, Latus, Arundel, Briscoe; Brown, Nicklas; Nicholson, Lee, Aldous, Scott, Smith, Golden. Substitutes: Lyles, Presley, Bell, Sullivan.
Referee: G Stokes (RFL).