About twenty years ago, I sprang for a state of the art, best that money could buy, a Porter Cable 12 volt cordless drill. (the highest voltage then). It came with a charger, steel carrying case and two nicad battery packs. I got a lot of good use out of it over the years. About eight years ago, the battery packs started to die. I bought one new one for $50 or so, which has since died. At that point, I ended up with three dead batteries and a really nice drill that I couldn't use.
I intend to rebuild two of the batteries with new NiMH cells eventually, but for now, I decided that as long as it is a 12 volt drill, it can run from a 12 volt battery pack, of which I have several. This battery case was fairly easy to convert. Some of them may be harder or easier than mine.
You will have to open it up and engineer it to hold the contact plates firmly in place with the wires attached. If you want to do this with a drill that is less than 12 volts, you will have to determine a way to drop the voltage to a safe level. Putting a resistor in line is the simplest way. If your drill is a higher voltage, I don't know of any simple way to provide a higher voltage.
At every step of the wiring, it is a good idea to check the wiring with a continuity tester or ohmmeter to determine that the connections are complete and that there are no opens or shorts.
Before chopping, cutting, drilling, examine the components to determine the best path for the wires. It is a good idea to mark the ends of the base and top of the case to prevent confusion.
If you have problems with my instructions, drill a hole through your hand, set your hair on fire or burn down your house, all correspondence regarding these issues should be made to my attorney. You will be promptly awarded 16.4 million dollars after sending the appropriate handling fees to his PO Box in Nigeria.)