Because registry changes are not immediately flushed to disk, if a machine loses power immediately after an application modifies the registry, the application’s registry changes may not be saved. If this occurs, the application may observe the following effects when the system restarts:
- Registry changes made by the application may not be visible
- A newly installed driver may no longer appear to be installed, and will need to be reinstalled
- A newly uninstalled driver will still be installed, and need to be uninstalled again
An application or installer can request that its registry modifications be written to disk immediately using the RegFlushKey API. However, calling RegFlushKey is an expensive operation that significantly affects system-wide performance. Applications and installers should only call this API if they must guarantee that their registry modifications are immediately persisted to disk.
The default "Power button action" is set to "Shutdown" on Windows systems to cause a shutdown to occur when the power button is pressed. If the "Power button action" is set to "Do nothing", pending disk writes are not saved.
The following links provide more information on this topic:
Windows Kernel event ID 41 error "The system has rebooted without cleanly shutting down first" in Windows 7 or Windows Server 2008 R2
RegFlushKey function (Windows)
Article ID: 2784761 - Last Review: Nov 28, 2012 - Revision: 1