Unfortunately capacitors or batteries can only do the job. Be careful with batteries, you will need control circuits. If the problem was only in the RAM, the power supply could be isolated via a resistor, and a capacitor added at the RAM. This would hold the RAM info longer. A similar schiem could be used with the Processor, but many of the newer processors are low voltage high current, which would require a good strategy. I am not totally familiar with the archatechture every PC, so don't assume anything. Since most PC's have a great deal of room inside ( not the power supply) caps can be added. You will need to know the current draw to calculate the time constant.