It sounds like you're looking for Robot AL-76 Goes Astray, by Isaac Asimov, collected in The Rest Of The Robots (and, I suspect, a lot of other books).
A robot intended for mining on the Moon gets lost on Earth; it attempts to perform its mining job, and puts together its own mining equipment from junk parts that it scavenges. It comes up with something that's a lot more efficient than the standard equipment - from memory, it demolishes a mountain using something powered by a small battery.
In the end, the robot is ordered to forget what it did, which it does, all too literally.
But this Disinto worked differently. I went through the rubbish with a
microscope, and would you like to see the only source of power of any
kind that I found?"
"What was it?"
"Just this! And we'll never know how he did it." And Austin Wilde held
up the source of power that had enabled a Disinto to chew up a
mountain in half a second, two flashlight batteries!
You can read the full story online here;