I am currently working on a program to immediately clear the list of previously executed commands that appear in the "Start → Start Windows" dialog box. The procedure for clearing this list by deleting the key HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ RunMRU is well documented ; however, before these changes take effect, it seems necessary to do one of the following:
- Reboot the computer.
- Choose Start → Shut Down, and then Cancel.
None of them are ideal for the task I'm trying to accomplish: # 1 is extremely destructive for the user, and # 2 requires additional user interaction.
Does anyone know how to immediately (and programmatically) force this information to reload without requiring any interaction with the user, as well as minimizing the disruption of another user? I would like the user to run a story that needs to be cleared immediately after the execution of my program, without any further actions on their part (for example, using the "Shutdown" → "Cancel" trick in # 2 above) or forcing a reboot.
Or, to approach the problem from a different angle: When you click "Start" → "Shutdown" → "Cancel", Windows Explorer reloads the RunMUI key. Is there a way to force a similar reboot without the user selecting “Shut Down” and then “Cancel”?
Things I've already tried:
- Monitor the status of explorer.exe using procmon when choosing Shutdown and then Cancel. I see that Explorer is writing the RunMRU key, but was unable to determine what causes this.
- Numerous Google searches in the lines "reboot runmru without rebooting." Most results still recommend Method # 1 above, although some suggest # 2.
- Limited validation of the MSDN API. The RegFlushKey call seems promising, but I haven't used it before, so I don't know if it will be applied to registry cache information by various processes.
Any suggestions or other information are welcome.
windows privacy registry windows-explorer
stormlash
source share