Exemple #1
0
        public bool DisableAutoPlay()
        {
            try
            {
                RegistrySettings.ModifyHKLMRegistryValue(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer",
                                                         "NoDriveTypeAutorun",
                                                         "",
                                                         177,
                                                         RegistryValueKind.DWord, true);

                RegistrySettings.ModifyHKCURegistryValue(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer",
                                                         "NoDriveTypeAutorun",
                                                         "",
                                                         177,
                                                         RegistryValueKind.DWord, true);

                return(true);
            }
            catch (Win32Exception ex)
            {
                Logging.LogErrorMessage("Error Disabling AutoPlay");
                Logging.LogErrorMessage(ex.Message);
            }

            return(false);
        }
Exemple #2
0
        public bool DisableShowSuggestions()
        {
            //http://www.winhelponline.com/blog/how-to-disable-start-menu-ads-or-suggestions-in-windows-10/
            //https://answers.microsoft.com/en-us/windows/forum/windows_10-start/how-can-powershell-be-used-to-automate-turning-off/c10ca270-2ce9-44f3-9cba-712eb9ba6942
            if (!RegistrySettings.ModifyHKCURegistryValue(@"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager",
                                                          "SystemPaneSuggestionsEnabled",
                                                          "",
                                                          0,
                                                          RegistryValueKind.DWord, true))
            {
            }

            if (!RegistrySettings.ModifyHKCURegistryValue(@"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\",
                                                          "SoftLandingEnabled",
                                                          "",
                                                          0,
                                                          RegistryValueKind.DWord, true))
            {
            }

            if (!RegistrySettings.ModifyHKCURegistryValue(@"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\",
                                                          "RotatingLockScreenEnabled",
                                                          "",
                                                          0,
                                                          RegistryValueKind.DWord, true))
            {
            }

            return(true);
        }
Exemple #3
0
 public bool EnableSaveTaskbarThumbnailPreviews()
 {
     return(RegistrySettings.ModifyHKCURegistryValue(@"Software\Microsoft\Windows\DWM",
                                                     "AlwaysHibernateThumbnails",
                                                     "",
                                                     1,
                                                     RegistryValueKind.DWord, true));
 }
Exemple #4
0
 public bool DisableAeroPeek()
 {
     return(RegistrySettings.ModifyHKCURegistryValue(@"Software\Microsoft\Windows\DWM",
                                                     "EnableAeroPeek",
                                                     "",
                                                     0,
                                                     RegistryValueKind.DWord, true));
 }
Exemple #5
0
 private bool SetTaskbarAnimation()
 {
     return(RegistrySettings.ModifyHKCURegistryValue(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced",
                                                     "TaskbarAnimations",
                                                     "",
                                                     0,
                                                     RegistryValueKind.DWord, true));
 }
Exemple #6
0
 private bool SetDropShadow()
 {
     return(RegistrySettings.ModifyHKCURegistryValue(@"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced",
                                                     "ListviewShadow",
                                                     "",
                                                     0,
                                                     RegistryValueKind.DWord, true));
 }
Exemple #7
0
 private bool SetAnimateWindowsWhenMinMax()
 {
     return(RegistrySettings.ModifyHKCURegistryValue(@"Control Panel\Desktop\WindowMetrics",
                                                     "MinAnimate",
                                                     "",
                                                     0,
                                                     RegistryValueKind.DWord, true));
 }
Exemple #8
0
        //private bool SetUserPreferencesMask()
        //{
        //    //List of bits for the User Preferences Mask - http://technet.microsoft.com/en-us/library/cc957204.aspx

        //    return RegistrySettings.ModifyHKCURegistryBinaryValue(@"Control Panel\Desktop", "UserPreferencesMask", new byte[] { 0x90, 0x22, 0x07, 0x00, 0x10, 0x00, 0x00, 0x00 });
        //}

        private bool SetUISettingsToCustom(string regKey)
        {
            //Setting this value to 3 will ensure the UI settings are set to "Custom", allowing for changes
            return(RegistrySettings.ModifyHKCURegistryValue(regKey,
                                                            "VisualFXSetting",
                                                            "",
                                                            3,
                                                            RegistryValueKind.DWord,
                                                            true));
        }
Exemple #9
0
        public bool SetExeToRunAsAdministrator()
        {
            try
            {
                return(RegistrySettings.ModifyHKCURegistryValue(Resources.RegistrySettingRunAsAdministrator,
                                                                @"C:\HLC\NexGen.exe",
                                                                "RUNASADMIN",
                                                                0,
                                                                RegistryValueKind.String, true));
            }
            catch (Exception exc)
            {
                Logging.LogErrorMessage("Error Setting EXE to Run As Administrator");
                Logging.LogErrorMessage(exc.Message);
            }

            return(false);
        }
Exemple #10
0
        public bool DisableAppNotifications(bool bWindows10)
        {
            //http://superuser.com/questions/1140134/how-do-i-turn-off-get-notifications-from-apps-and-other-senders-in-windows-10
            //https://www.tenforums.com/tutorials/4111-notifications-apps-turn-off-windows-10-a.html#option2

            //HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PushNotifications

            //ToastEnabled DWORD

            //0 = Turn off
            //1 = Turn on
            //string _psScript = Resources.RegistryHKCUPushNotifications;
            //SystemOptions.PerformPowerShell("", "", "", "", "", "", "", _psScript);

            //_psScript = Resources.RegistryHKCUToastEnabled;
            //SystemOptions.PerformPowerShell("", "", "", "", "", "", "", _psScript);

            //if( bWindows10 )
            {
                if (!RegistrySettings.ModifyHKCURegistryValue(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications",
                                                              "ToastEnabled",
                                                              "",
                                                              0,
                                                              RegistryValueKind.DWord, true))
                {
                    Logging.LogErrorMessage(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications\ToastEnabled");
                }
            }
            //else
            //{
            //    RegistrySettings.ModifyHKCURegistryValue(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications",
            //        "NoToastApplicationNotification ",
            //        "",
            //        1,
            //        RegistryValueKind.DWord, true);
            //}

            DisableShowSuggestions();

            return(true);
        }
Exemple #11
0
        private bool EnableControlPanelIconForUser()
        {
            try
            {
                RegistrySettings.ModifyHKCURegistryValue(Resources.RegistrySettingClassicStartMenu,
                                                         "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}",
                                                         "",
                                                         0,
                                                         RegistryValueKind.DWord, true);
                RegistrySettings.ModifyHKCURegistryValue(Resources.RegistrySettingNewStartPanel,
                                                         "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}",
                                                         "",
                                                         0,
                                                         RegistryValueKind.DWord, true);

                RegistrySettings.ModifyHKLMRegistryValue(Resources.RegistrySettingClassicStartMenu,
                                                         "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}",
                                                         "",
                                                         0,
                                                         RegistryValueKind.DWord, true);

                RegistrySettings.ModifyHKLMRegistryValue(Resources.RegistrySettingNewStartPanel,
                                                         "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}",
                                                         "",
                                                         0,
                                                         RegistryValueKind.DWord, true);


                return(true);
            }
            catch (Exception ex)
            {
                Logging.LogErrorMessage("Error Enabling Network Icons");
                Logging.LogErrorMessage(ex.Message);
            }

            return(false);
        }
Exemple #12
0
        public bool DisableNotificationCenter()
        {
            //HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer

            //DisableNotificationCenter DWORD

            string _psScript = Resources.RegistrySettingWindowsExplorer;

            SystemOptions.PerformPowerShell("", "", "", "", "", "", "", _psScript);

            //_psScript = Resources.RegistryHKCUDisableNotificationCenter;
            //SystemOptions.PerformPowerShell("", "", "", "", "", "", "", _psScript);

            //1 = Turn off
            //0 = Turn on
            RegistrySettings.ModifyHKCURegistryValue(@"SOFTWARE\Policies\Microsoft\Windows\Explorer",
                                                     "DisableNotificationCenter",
                                                     "",
                                                     1,
                                                     RegistryValueKind.DWord, true);

            return(true);
        }
Exemple #13
0
        private bool EnableComputerIconFOrUser()
        {
            try
            {
                RegistrySettings.ModifyHKCURegistryValue(Resources.RegistrySettingClassicStartMenu,
                                                         "{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
                                                         "",
                                                         0,
                                                         RegistryValueKind.DWord, true);
                RegistrySettings.ModifyHKCURegistryValue(Resources.RegistrySettingNewStartPanel,
                                                         "{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
                                                         "",
                                                         0,
                                                         RegistryValueKind.DWord, true);

                RegistrySettings.ModifyHKLMRegistryValue(Resources.RegistrySettingClassicStartMenu,
                                                         "{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
                                                         "",
                                                         0,
                                                         RegistryValueKind.DWord, true);
                RegistrySettings.ModifyHKLMRegistryValue(Resources.RegistrySettingNewStartPanel,
                                                         "{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
                                                         "",
                                                         0,
                                                         RegistryValueKind.DWord, true);

                return(true);
            }
            catch (Exception ex)
            {
                Logging.LogErrorMessage("Error Enabling Computer Icon");
                Logging.LogErrorMessage(ex.Message);
            }

            return(false);
        }