TL;DR: Shut your system down properly.
Hibernation is nothing to do with shutting down, it is closely related to suspend-to-RAM (sleep) except with the contents of RAM pushed to disk in order for it to be read back in and operation resumed from exactly where the system left off.
If you want the changes to persist then you need to disable hibernation and Windows Fastboot (which is a subset of hibernation). Or you can actually reboot rather than hibernate and restart.
The reason changes are not persisted is because they are not written to disk yet except in the hibernation file. Which you are deleting, meaning that the filesystem may well have to repair itself and go back to a "last known good" state.
While the system is hibernated there are going to be several key filesystem structures that may not have been written out to disk and are instead in RAM. The system will, upon resuming from hibernation, expect the disk to be in a very particular state and it is possible that disk caches and important system files get saved to the hibernation file rather than to the actual disk.
If you do a proper shutdown then Windows will properly flush working memory to disk, and then unmount the disk cleanly before powering down.
To force a proper shutdown open a command prompt and type
shutdown /s /f /t 0
/s
is "shutdown", /f
to force, and /t 0
to mean "now" (time = 0 seconds)
Or you can just disable fastboot and hibernation.
Read more at HowtoGeek: Shutting Down Doesn’t Fully Shut Down Windows 10 (But Restarting Does)
Related to you doing a hard shutdown the problem there is that Windows is not guaranteed to write any changes out to disk the same millisecond (or even minute) that you make the change. It will almost certainly be written within a few minutes but the probablility of it having actually been written will increase over time. It's unlikely to be written immediately, then near to the time you make the change the probability increases sharply, and will almost certainly have been written within an hour.
The thing is though, that by forcing a hard shutdown you are not giving the system a chance to safely write changes to disk.
Most modern filesystems are written to make changes in the safest way possible. In the past they have been referred to as "atomic", as in the change has either happened or it has not.
Today we know them as Journalled file systems because they keep a log of operations that will happen that can be either reverted or rolled forwards in the event of system failure and reboot. Upon startup from a power failure the system checks the journal and for each transaction it checks if the actual file data is written to disk and is "good". If it is then the transation rolls forwards and is completed, if not then it rolls back to the old data.
By using this order the disk is almost always in an easy to repair state.
But by forcing your system to power down unexpectedly you cannot guarantee whether the transaction has progressed far enough to roll forwards upon repair, and chances are that an operating system such as Linux will not care as much as Windows about the transaction history and is more likely than not to just make changes that roll everything backwards rather than forwards.
If you rebooted into Windows it might try or be able to repair the disk properly as it has a more intimate knowledge of the filesystem.
2"he registry change does not appear after reboot." - The registry change does not go into effect until the reboot, and typically, only File Explorer has to be restarted. It all depends on what behavior the registry change is intended to do if a reboot is actually required. The actual key is modified, when it's modified, which answers your question. – Ramhound – 2018-06-14T18:09:46.093
8What do you mean by a hard shutdown? Holding the power button until it shuts down? That process bypasses writing out any pending disk cache writes. – DavidPostill – 2018-06-14T18:10:49.877
2@Ramhound I get that it doesn't go into effect, but why hasn't it been written to the disk? I make the edit, hard power down and then change isn't there any more. Whether or not it went into effect in memory doesn't matter at that point – Shrout1 – 2018-06-14T18:10:58.043
1Does your Linux registry tool support reading from the transaction log? – user1686 – 2018-06-14T18:11:15.013
@DavidPostill So the registry edit is a "pending change"? – Shrout1 – 2018-06-14T18:11:20.197
@grawity I'm using chntpw but I'm not intimately familiar with it. – Shrout1 – 2018-06-14T18:11:39.910
@Shrout1 Anything that is written to disk is a pending change until it is actually written. – DavidPostill – 2018-06-14T18:12:52.007
@DavidPostill Ok - so when does it commit the change to disk? At logoff? Shutdown? Seems like I can circumvent the change by interrupting the normal reboot cycle. – Shrout1 – 2018-06-14T18:13:55.810
@Shrout1 Read https://www.google.com/search?q=when+does+windows+flush+disk+caches&ie=utf-8&oe=utf-8&client=firefox-b-ab
– DavidPostill – 2018-06-14T18:14:18.9702@Shrout1 - Why are you forcing the machine to turn off instead of safely shutting the machine done? – Ramhound – 2018-06-14T18:14:59.290
6@Ramhound I'm running tests to see what happens if the system doesn't shut down gracefully. Random, I know, but I need to know exactly how this is committed to memory so that we don't lose anything on our systems if it isn't handled correctly. – Shrout1 – 2018-06-14T18:15:47.850
@DavidPostill Hey I disabled Disk Write Caching per this tenforums post but it didn't seem to make a difference. Let me know if I'm missing something else.
– Shrout1 – 2018-06-14T18:43:01.770@Shrout1: Do we know that changing something in
regedit.exe
actually changes the registry immediately? My impression was thatregedit.exe
changes only got written to registry whenregedit.exe
was closed. An easy way to check would be to open a second copy ofregedit.exe
after adding1111
but before closing the original window and see if the key appeared in the new copy too. – Jacob Manaker – 2018-06-17T04:50:56.227@Jacob Manaker I closed regedit.exe after adding the key, before the hard power down. Regedit adds to a cache that Windows flushes to the disk at some unknown interval. Google regflushkey and lazy flush for more info :) – Shrout1 – 2018-06-17T05:11:36.517
@Shrout1: Ah, OK; great. The question was ambiguous enough that I got worried you weren't testing what you thought you were. – Jacob Manaker – 2018-06-18T14:15:59.213