WASHINGTON — One company threatened to sue 8,000 coffee shops, hotels and retailers for patent infringement because they had set up Wi-Fi networks for their customers. Another claimed that hundreds of small businesses were violating its patents by attaching a document scanner to an office computer system. One claimed rights to royalties from anyone producing a podcast.

Now the Obama administration is cracking down on what many call patent trolls, shell companies that exist merely for the purpose of asserting that they should be paid because they hold patents that are being infringed by some software or electronic process.

The companies exploded onto the technology scene in the last two years, accounting for more than half of the 4,000 patent infringement lawsuits filed in the United States last year, according to several studies, up from 45 percent the year before and from less than 30 percent in every prior year.

That surge can be traced partly to the very law that was supposed to stamp out some of the trouble. The America Invents Act, signed in 2011, made it illegal to file a single lawsuit claiming a whole bunch of defendants had infringed a patent in the same way. Now, a patent holder must file individual lawsuits against each company, which has caused the number of lawsuits to soar, patent experts say.