As long as rats have roamed the underbelly of New York City, mayor after mayor has seized the opportunity to act the general in a long-running war to turn back the rat armies.

And yet the rats remain.

On Wednesday, Mayor Bill de Blasio became the latest city leader to pick up his sword in earnest. Saying the city wanted “more rat corpses,” he declared a $32 million assault on the most problematic rat strongholds — parts of Lower Manhattan and Brooklyn’s Bedford-Stuyvesant neighborhood and along the Grand Concourse in the Bronx — and promised to reduce the number of rats in those areas by 70 percent by the end of next year.

“I don’t know any New Yorker who likes rats,” Mr. de Blasio said at a news conference filled with rat puns, references to rat history and mayoral praise for a rodent whose affinity for pizza made him a social media star.

The plan involves covering dirt floors at scores of public housing buildings and deploying 336 new rat-proof garbage bins that compact trash using solar power and cost $7,000 a piece. (The city already has 1,100 such bins around the city.)