If Donnie Walsh had returned as president of the Knicks, he said Mike D’Antoni would be a shoo-in to return as the team’s coach.

But even with Walsh’s exit June 30, the outgoing executive sounded confident D’Antoni will be back to at least fulfill the final year of his contract. Walsh, once he becomes a consultant, will recommend him strongly to owner James Dolan.

In a two-hour meeting with D’Antoni yesterday, Walsh told the Knicks coach he wants him to come back. Of course, things could always change depending on who gets hired as general manager, but with a lockout in the offing, the Knicks in no rush to hire a new president and D’Antoni making $6 million in his final season, it does not seem likely he’ll be fired. Besides, Dolan likes D’Antoni.

“Mike was one of the only people that I talked to about this before I came up here,” Walsh said. “Mike and I like each other. We worked very hard together. We knew the first two years were going to be very difficult. I felt terrible, as a general manager, I had to put my coach in a position where he didn’t have a chance to win. And I put him there. And I can remember looking down, thinking, ‘What have I done to this kid?’ when we were losing.

“I think we both feel that we did the best job that could possibly be done under the circumstances, and that the franchise is on solid ground to go forward in the future. And so I implored him to stay with it, because I want to see the franchise do well. And I think he’s a good coach to make that happen. It will depend on what we can put around the players we have here now and fill in the blanks.”

D’Antoni has the support of Amar’e Stoudemire, but Carmelo Anthony has been lukewarm. It’s thought CAA, the agency that represents Anthony, would like to see Kentucky coach John Calipari, also a CAA client, take over the reins.

“We’re ending a relationship in a month and I wanted to let him know that I appreciated everything he did and I know that he is a guy that can take this team to the next level and I wanted to voice that,” Walsh said of D’Antoni. “I’m telling him I am going to be here for a year and I am going to be talking to him and I do support him.”