Exemplo n.º 1
0
        public void Enable(bool Enable)
        {
            RegEdit.SetValue(
                @"HKEY_CURRENT_USER\Software\Microsoft\Personalization\Settings",
                "AcceptedPrivacyPolicy", Enable ? 0 : 1
                );
            RegEdit.SetValue(
                @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Language",
                "Enabled", Enable ? 0 : 1
                );
            RegEdit.SetValue(
                @"HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization",
                "RestrictImplicitTextCollection", Enable ? 1 : 0
                );
            RegEdit.SetValue(
                @"HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization",
                "RestrictImplicitInkCollection", Enable ? 1 : 0
                );
            RegEdit.SetValue(
                @"HKEY_CURRENT_USER\Software\Microsoft\InputPersonalization\TrainedDataStore",
                "HarvestContacts", Enable ? 0 : 1
                );

            RegEdit.SetValue(
                @"HKEY_CURRENT_USER\Control Panel\International\User Profile",
                "HttpAcceptLanguageOptOut", 1 // screenshot 1 - put tweak somewhere else !!
                );

            if (!Enable)
            {
                return;
            }

            Dir.DeleteDir(@"C:\Users\Bob Vandevliet\AppData\Roaming\Microsoft\Spelling");
        }
Exemplo n.º 2
0
        public void Enable(bool Enable)
        {
            Service.EnableDisable("SDRSVC", Enable, ServiceStartMode.Manual);

            Service.EnableDisable("wbengine", Enable, ServiceStartMode.Manual);

            Service.EnableDisable("VSS", Enable, ServiceStartMode.Manual);

            Service.EnableDisable("swprv", Enable, ServiceStartMode.Manual);

            Service.EnableDisable("SQLWriter", Enable, ServiceStartMode.Manual); // DEFAULT VALUES NOT FOUND, NEED TO VERIFY !!

            if (!Enable)
            {
                Dir.DeleteDir($@"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\Microsoft\Windows\FileHistory");
            }
        }
Exemplo n.º 3
0
        public void Enable(bool Enable)
        {
            Service.EnableDisable("diagsvc", Enable, ServiceStartMode.Manual);

            Service.EnableDisable("DPS", Enable, ServiceStartMode.Automatic);

            Service.EnableDisable("WdiServiceHost", Enable, ServiceStartMode.Manual);

            Service.EnableDisable("WdiSystemHost", Enable, ServiceStartMode.Manual);

            if (!Enable)
            {
                Service.EnableDisable("DiagTrack", Enable, ServiceStartMode.Automatic);                             // ALSO FOR TELEMETRY !!

                Service.EnableDisable("dmwappushsvc", Enable, ServiceStartMode.Manual);                             // ALSO FOR TELEMETRY !!

                Service.EnableDisable("diagnosticshub.standardcollector.service", Enable, ServiceStartMode.Manual); // ALSO FOR TELEMETRY !!

                string key = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\AppCompat";
                //RegEdit.SetValue(key, "DisableUAR", 1);     // Steps Recorder
                RegEdit.SetValue(key, "DisableInventory", 1); // Inventory Collector

                Dir.DeleteDir(@"C:\ProgramData\Microsoft\Diagnosis\ETLLogs");

                RegEdit.SetValue(
                    @"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener",
                    "Start", 0
                    ); // ALSO FOR TELEMETRY ..
            }

            /**
             * Always disable requests for feedback (diagnostic usage data).
             */
            RegEdit.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Siuf\Rules", "NumberOfSIUFInPeriod", 0);

            Service.EnableDisable("pla", Enable, ServiceStartMode.Manual);
        }
Exemplo n.º 4
0
        public void Enable(bool Enable)
        {
            RegEdit.SetValue(
                @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Windows Search",
                "AllowCortana", Enable ? 0 : 1
                );

            RegEdit.SetValue(
                @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Cortana",
                "IsAvailable", Enable ? 0 : 1
                );

            RegEdit.SetValue(
                @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced",
                "ShowCortanaButton", Enable ? 0 : 1
                );

            //RegEdit.SetValue(
            //    @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search",
            //    "SearchboxTaskbarMode", Enable ? 0 : 1
            //);

            if (Enable)
            {
                /**
                 * Remove Cortana ..
                 */
                Commands.InvokePS("Get-AppxPackage -AllUsers Microsoft.Windows.Cortana | Remove-AppxPackage"); // <= 1909
                Commands.InvokePS("Get-AppxPackage -AllUsers Microsoft.549981C3F5F10 | Remove-AppxPackage");   // >= 2004

                int loop_cortana = 0;

                while (Directory.Exists(@"C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy") && loop_cortana < 20)
                {
                    Process[] searchProcesses = Process.GetProcessesByName("SearchUI");

                    foreach (Process searchProcess in searchProcesses)
                    {
                        try
                        {
                            searchProcess.Kill();
                        }
                        catch (Exception)
                        {
                            Commands.taskkill("SearchUI");
                        }
                    }

                    try
                    {
                        if (loop_cortana % 2 == 0)
                        {
                            TakeOwnership.Folder(@"C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy");
                        }

                        Dir.DeleteDir(@"C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy");
                    }
                    catch (Exception)
                    {
                    }

                    loop_cortana++;
                }

                if (loop_cortana >= 20)
                {
                    Console.WriteLine("Failed to properly disable \"Cortana\"!");
                }

                /**
                 * Remove SearchApp ..
                 */
                Commands.InvokePS("Get-AppxPackage -AllUsers Microsoft.Windows.Search | Remove-AppxPackage");

                int loop_searchapp = 0;

                while (Directory.Exists(@"Microsoft.Windows.Search_cw5n1h2txyewy") && loop_searchapp < 20)
                {
                    Process[] searchProcesses = Process.GetProcessesByName("SearchApp");

                    foreach (Process searchProcess in searchProcesses)
                    {
                        try
                        {
                            searchProcess.Kill();
                        }
                        catch (Exception)
                        {
                            Commands.taskkill("SearchApp");
                        }
                    }

                    try
                    {
                        if (loop_searchapp % 2 == 0)
                        {
                            TakeOwnership.Folder(@"Microsoft.Windows.Search_cw5n1h2txyewy");
                        }

                        Dir.DeleteDir(@"Microsoft.Windows.Search_cw5n1h2txyewy");
                    }
                    catch (Exception)
                    {
                    }

                    loop_searchapp++;
                }

                if (loop_searchapp >= 20)
                {
                    Console.WriteLine("Failed to properly disable \"Search App\"!");
                }
            }
            else // if !Enable
            {
                dynamic WinVer = Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "ReleaseId", 0);

                /**
                 * Re-enable Cortana ..
                 */
                try
                {
                    if ((int)WinVer <= 1909)
                    {
                        Commands.InvokePS("Get-AppxPackage -AllUsers Microsoft.Windows.Cortana | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}"); // <= 1909
                    }
                    else
                    {
                        Commands.InvokePS("Get-AppxPackage -AllUsers Microsoft.549981C3F5F10 | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}");   // >= 2004
                    }
                }
                catch (Exception) { }

                /**
                 * Re-enable SearchApp ..
                 */
                try
                {
                    Commands.InvokePS("Get-AppxPackage -AllUsers Microsoft.Windows.Search | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}");
                }
                catch (Exception) { }
            }
        }