You are currently offline, waiting for your internet to reconnect

Saving application registry changes on Windows 8 or Windows Server 2012

To maximize performance, updates to the registry in Windows 8 and Windows Server 2012 are not immediately flushed to disk. Instead, the registry flushes modified registry data to the disk at regular intervals of time. In addition, modified registry data is saved to disk when the system shuts down. In most cases, these mechanisms are sufficient to ensure that registry modifications safely reach the disk.

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.
More information
As noted above, if a machine loses power immediately after an application modifies the registry, the application’s registry changes may not be saved.  If Shutdown or Restart is initiated and they complete successfully, unsaved registry modifications are flushed to disk before the machine shuts down. The Sleep and Hibernate options are not guaranteed to flush unsaved registry modifications to disk, but if a machine successfully resumes from sleep or hibernate, any registry changes made prior to sleeping or hibernating will still be visible after resuming. To summarize, any action during Shutdown, Restart, Sleep or Hibernate that prevents the machine from resuming successfully can cause unsaved registry changes to not be saved.

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)
lazy flush
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Article ID: 2784761 - Last Review: 11/28/2012 01:14:00 - Revision: 4.0

Windows 8, Windows Server 2012 Standard, Windows Server 2012 Datacenter, Windows 8 Pro

  • KB2784761