Is it possible to make an "energy harvester" that drains old batteries?
Is this possible? Of course it is. But is it practical? Not at all.
The comparison is not to the cost of batteries. Batteries are expensive. The comparison has to be to the cost of electricity. Using some very rough numbers:
Cost of electricity per kWh: US average is around 13 cents. Let's round up a bit to make the math simple and call it 20 cents per kWh.
How much does power does a battery hold? That varies a lot, depending on size. A few examples:

LR20 = &quot;D&quot; = 2.5 Wh (that's Wh, not kWh) - 27 Wh
A typical 12V car battery = 48 Amp-hours = 576 Wh
A large 12V car (or marine) battery = 100 Amp-hours = 1,200 Wh
A large Tesla battery pack = 100 kWh

Let's assume that each battery starts out filled to 50% capacity (unlikely), and that the magic energy harvester can get every last drop of electricity out of the battery (pretty much impossible) and can do that with 100% perfect efficiency (also impossible). The $ value is:

LR20 = &quot;D&quot; = 0.0135 x 0.2 = $ 0.003 (less than a penny)
A typical 12V car battery = 0.288 x 0.2 = $ 0.058 (less than a dime)
A large 12V car battery = 0.6 x 0.2 = $ 0.12 (less than a quarter)
A large Tesla battery pack = 50 x 0.2 = $ 10.00

In the case of the small batteries, toss 'em (in an environmentally friendly way - there are plenty of commercial and government locations that accept used batteries for recycling).
In the case of the large batteries - the safety precautions needed to properly process the batteries will likely cost far more than the potential value of the stored electricity.
In general, subject to local laws, you can usually toss small batteries, especially non-rechargeable batteries (e.g., alkaline). However, if you do that, be extra careful with 9V batteries. 9V batteries have a potentially dangerous design flaw - the + and - terminals are right next to each other. If you take a 9V battery, even mostly dead, and short circuit the terminals, you can start a fire. With most other battery types the danger is incredibly small. But a 9V battery tossed in a trash bag that landed on a piece of aluminum foil or other conductive material could actually start a fire. A piece of electrical tape across the terminals before tossing the battery eliminates the danger. Video about 9-volt batteries.