President Trump on Thursday faulted the Obama administration, and Democratic rival Joseph R. Biden, for leaving the U.S. unprepared for the coronavirus crisis, as he took executive action to replenish federal stockpiles of medical supplies.

“Never again will another president inherit empty shelves or expired products,” Mr. Trump said on a visit to a medical supply distribution company near Allentown, Pennsylvania. “I’m determined that America will be fully prepared for any of the future outbreaks.”

The president also criticized Democratic Gov. Tom Wolf for what he called a slow plan to reopen the battleground state for business. About half of the state’s counties won’t be allowed to reopen until June 4, and some of them led by Republicans are rebelling against Mr. Wolf’s restrictions.

“We have to get your governor of Pennsylvania to start opening up a little bit,” the president told the workers at the Owens & Minor Inc. plant. “You have areas of Pennsylvania that are barely affected, and [state officials] want to keep them closed.”

A crowd of thousands greeted Mr. Trump outside the plant in the moderate swing district about 50 miles north of Philadelphia. One supporter held a sign saying, “Save us from the big bad Wolf.”

The president’s handling of the coronavirus crisis increasingly has become a threat to his reelection. A CBS News poll on Thursday showed that 43% of respondents say Mr. Trump is doing a good job, 5 points lower than three weeks ago and 10 points lower than in March.

Nearly 3 million Americans applied for unemployment benefits last week, the Bureau of Labor Statistics reported Thursday, bringing the number to 36 million over the two months since states began closing their economies.

Rick Bright, a top coronavirus vaccine researcher at the National Institutes of Health, testified in Congress Thursday that the administration ignored his warnings earlier this year to prepare for the pandemic.

Mr. Bright said he faced “hostility and marginalization” from officials at the Department of Health and Human Services who ignored his warnings to start work on a vaccine at the beginning of the outbreak and increase production of personal protective equipment.

The president dismissed Mr. Bright as “nothing more than a really unhappy disgruntled person.”

“I never met him. I don’t want to meet him,” Mr. Trump said. “But I watched him [on TV], and he looks like an angry, disgruntled employee, who, frankly, according to some people, didn’t do a very good job.”

But faced with such criticism of the administration’s response, the president and his advisers are making an increasingly robust defense of their handling of the crisis. On Thursday, they again took aim at the Obama administration’s actions reaching back more than a decade.

The president said his predecessor never replenished the Strategic National Stockpile after his administration distributed about 85 million N-95 masks in 2009 in response to an outbreak of the H1N1 swine flu. Mr. Trump said the effort “was not well-handled.”

“Under the previous administration, the stockpile was depleted and never fully refilled,” Mr. Trump said.

He also poked fun at “Sleepy Joe” for incorrectly calling the swine flu, “N1H1,” reversing the letters.

During the trip, the president signed an executive order delegating authority under the Defense Production Act to the U.S. International Development Finance Corporation to make loans to American companies to produce needed supplies such as N-95 masks and surgical gloves for the federal stockpile.

The president said the USIDFC normally invests in foreign countries, adding, “It will now also invest in our country.”

“Instead of one to three weeks worth of supplies — which we had less than that — the U.S. government will now stockpile three whole months, much of it made in the U.S.A.,” the president said. “As our country begins a safe and gradual reopening, we’re launching a monumental effor to replenish and rebult the Strategic National Stockpile.”

He noted that his administration has signed contracts with companies to manufacture 200,000 ventilators and has ordered 800 million N-95 respirators and face masks.

Mr. Biden said in a statement that the president has failed to provide enough testing and to provide “guidance for workplace safety” as governors wrestle with the decision of how quickly to let their states go back to work.

“The issue isn’t whether or not to reopen. We all want to reopen. It’s how to reopen safely and effectively,” Mr. Biden said. “And the Trump administration simply hasn’t done the work to make that happen — except to take care of themselves at the White House.”

Mr. Trump pointed to the administration’s achievement in delivering its 10 millionth test this week, although he said the milestone tends to make the U.S. look bad.

“When you test, you find something is wrong with people,” Mr. Trump said. “If we didn’t do any testing, we would have very few cases.”

More than 1.4 million COVID-19 cases have been reported in the U.S., with more than 85,000 deaths, in a population of about 330 million.

Critics have noted that the Trump administration had three years to replenish the stockpile of masks before the coronavirus pandemic hit. They also have criticized the White House for largely disbanding a pandemic response team at the National Security Council in 2018.

White House press secretary Kayleigh McEnany said Thursday that the “Obama-Biden [pandemic] plan … was insufficient; it wasn’t going to work. So what our administration did, under the leadership of President Trump, is do an entire 2018 pandemic preparedness report.”

She also said the administration conducted a pandemic preparedness exercise in August 2019 and completed an “after-action” report.

Mr. Trump said his plan “was much better … was much more complete, and which was a lot tougher.”

“We were given very little when we came into this administration,” he said.

The president also reiterated his prediction that a coronavirus vaccine will be available by the end of this year.

“I think distribution will take place almost simultaneously, because we’ve geared up the military,” he said, promising more details Friday.

Mr. Biden, the presumptive Democratic nominee who is leading the president in polls in Pennsylvania by an average of 4.5 percentage points, said Mr. Trump’s words and actions are deepening the nation’s political divide over the nation’s coronavirus response.

“At a time when we should be uniting our country, President Trump is trying to split Pennsylvanians into dueling camps, casting Democrats as doomsayers hoping to keep America grounded and Republicans as freedom fighters trying to liberate the economy,” Mr. Biden said. “This is a false choice, and it’s just his latest tactic in his mission of dividing Americans.”

The Strategic National Stockpile was created in 1999 to prepare for chemical, radiological, biological or nuclear attacks. Its role was expanded later to respond to terrorism attacks, natural disasters, the H1N1 flu and Ebola. The location of the stockpiles’ warehouses are secret.

Senior administration officials said the effort of manufacturing more supplies, and moving more of the medical supply chain back to the U.S., is aimed partly at enabling more people to keep working if there’s a surge of new cases after the summer.

“A big part of this effort is to make sure that people can go back to work in the fall,” an official said. “Not only will we be prepared if something comes up, the more that we stimulate the domestic supply and bring the supply into America, the more that industry and people will have the masks and protective equipment they need to safely return to work.”

One official said the administration is aiming to stockpile one billion masks.

“We’re not going to have all of those for the fall, but we do anticipate having 300 million,” the official said.

The administration didn’t provide an estimated cost of the effort.

But they said the U.S. is building about 200,000 ventilators, enough of a surplus that Mr. Trump has been offering the machines to other countries. Last year, they said, the U.S. made about 30,000 ventilators.