What you're looking for is an Uninterruptable Power Supply, also referred to as a "UPS" or "battery back-up."
A home UPS can be purchased from most electronics stores and websites for between one hundred and several hundred U.S. dollars.
system blackout
Using the shutdown feature properly closes all programs and files that are currently in use. If you just cut the power to the computer all of a sudden, those files that were in use at the time could lose data by not being saved, (shutdown) properly!!!
A complete loss in AC power
its is better to shutdown your computer because you save energy from the power supply
Load shedding is also known as a rolling blackout. It is an intentionally engineered electrical power shutdown, electricity delivery is stopped for non-overlapping periods of time over different parts of the distribution region. This is a last-resort that electric companies use to avoid a total blackout of the power system.
Non-volatile memory can retain its contents through a loss of power, assuming the shutdown was properly performed.
A computer UPS (Uninterruptible Power Supply) is designed to provide power to a computer system if normal power fails. The length of time a UPS will support a computer depends on the capacity of the UPS and the draw of the system being supported. Properly configured and installed, most systems will monitor the UPS and begin a normal shutdown when notified by the UPS that a power outage is in process. Some are large enough to maintain computer operations long enough for backup power generation to come online.
If you are running Windows Vista or Vista SP1, it's because of some logout/shutdown/sleep bugs that are still present in that operating system. If the computer won't turn off after waiting for a while, do a hard shutdown (i.e. hold the power button for a few seconds until the computer turns off). In general this won't have a negative result for your computer, but it would be helpful if Microsoft could get the bugs out of Windows Vista sleep/hibernation/logout.
To efficiently power your appliances during a blackout using a generator switch box, connect your generator to the switch box and then plug your appliances directly into the box. This allows you to easily switch between grid power and generator power, ensuring a seamless transition during a blackout. Make sure to properly size your generator to handle the power requirements of your appliances.
If the whole computer completely shutdown, then you just need to press the power button again.
Might be a virus or power problem. Also, check the cooling fan. If the cooling fan isn't working properly, your system can quickly overheat and will shut itself off.
The only way is to power it off from Main power supply. You can also wait for the computer revive. If you have shutdown problems the n you assign you CPU power button as the shutdown button in the power option available when you right click on desktop and go to properties.You might have that option some where else.