All data can be lost when a computer is turned off. The key to remember though is that there are two types of data you should be concerned about. First, there's the data you have saved on your hard drive in files and folders. Second, there's the meta-data that Windows keeps track of for programs to function. This includes things like the names of your hard drives; how much space is available; what type of processor you have as well as any other peripherals such as printers and scanners; and other types of general data. In other words, any data that you save in a file or add to folders is recoverable even when the computer is turned off. If you think of the hard drive as being like a filing cabinet, then this would be equivalent to just losing all of your files. The meta-data however can't be recovered so easily and it's important because the operating system uses the information contained within it to function properly. For example, without Windows knowing what type of printer you have installed on your system it won't allow you to use it.

Why does meta-data become lost while file contents are still available?

Typically, when a computer shuts down or is turned off for any reason including a power outage, the only thing that happens is that the power is turned off. The computer's central processing unit (CPU) and other components remain functional and powered on and any data that was still being written to disk at the time of shutdown remains intact. However, Windows shuts down completely and will clear out its memory before it does so which includes clearing out all meta-data mentioned above.

How can I recover lost meta-data?

While you won't be able to recover your saved files or folders if the computer is turned off due to a power outage, you may be able to recover some of your meta-data by turning on your computer with either a bootable CD or USB drive with data recovery software. Be aware however that this will only work if the data hasn't been written over yet by new data. Since Windows shuts down completely, this includes clearing out all of its memory including the information required to find and reconstruct lost meta-data.

If it's too late and the meta-data has already been cleared out, then you'll need to use a different recovery tool such as one that tries to recover deleted files including emails and other types of documents that can provide evidence in a case for example. Be aware though that if you're trying to recover files that were deleted while your computer was still on, such as after a power outage caused by a storm or another event, there's always a chance they may have been overwritten with newer data at some point which means they will no longer be recoverable. This is because when you save data to your hard drive, it's written over older files which makes them harder to recover after they've been deleted.

How can I prevent this in the future?

One way would be to implement a power supply that includes an uninterruptible power supply (UPS) unit. Among other things, this typically ensures that even if there is a loss of power due to circumstances beyond your control such as a storm or blackout, you'll still have at least enough time for your computer's hardware components to shut down properly before its battery runs out of power. However, make sure that the UPS unit itself has some sort of indicator light or alarm on it so that if the battery does run low, you can be notified to avoid any damage to your computer's components.

It should also be noted that if you use a laptop and the battery has gone dead due to running on AC power for an extended time, then once you plug it into an outlet and turn it back on, all data that was written to disk after the last shutdown will still be available. This is because when laptops are plugged in they don't completely shut down as PCs do; instead, they enter a state called "hibernate". During this process, all of its memory (CPU registers) is transferred from RAM over to its hard drive where it waits until it needs to come back out of hibernation and activate its operating system and other software programs.