If you can, write the error code down and post it here. If the error screen closes to quickly to read the code/number, see if pressing and holding F8 right after the BIOS post can open the Safe Mode options list... if you can get to the list, selecting "Disable automatic restart on system failure" should allow time to read the read the error number/s.
If the error screen doesn't allow time to bring up the Safe Mode list:
a) If it's a PC: Open the case and check if the CPU fan is working, blow off any heavy dust with a compressed air can, check the RAM modules aren't lose on the slots, check digital and electrical connections to motherboard and hard drive.
b) If it's a laptop: See if the cooling openning on the bottom is clear of dust or lint... if it's clear and nothing changes, there's nothing more you can do short of replacing the battery or power adapter.. all other repairs should be left to a technician. If you suspect of the battery of power adapter, see
EDITED: If you have the Windows XP installation CD, run CHKDSK from the Recovery Console... (type: chkdsk c: /r). If it doesn't help, you'll probably have to repair-install Windows XP.. If you don't have the CD, see if you can run the Automated System Recovery.