void SetRegistryExecute(object param) { try { using (_registryEditor = new RegistryEditor(MachineName, LookupSource, StartRemoteRegistryServiceIfNeeded)) { _registryEditor.SetStartupAppToRegistry(RegistryKey, RegistryValue); } MessageBox.Show("Success !", "", MessageBoxButton.OK, MessageBoxImage.Information); RegistryKey = string.Empty; RegistryValue = string.Empty; } catch (Exception ex) { MessageBox.Show(ex.Message); } ShowStartupAppsExecute(null); }