Hey guys so I'm trying to delete the Run history when the user presses Windows + R key so there is no history I made a method for this, and you will see the parameter this is HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU
But I'm worried I will delete the wrong items, this is my code:
 //this method will clear the run history from the registry
    private void ClearRunHistory(string RegRunHistoryDirectory)
    {
        using (RegistryKey key = Registry.CurrentUser.OpenSubKey(RegRunHistoryDirectory, true))
        {
            if (key == null)
            {
                //if key doesnt exist then do nothing
            }
            else
            {
                key.DeleteValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU");
            }
        }
    }
 
     
    