예제 #1
0
        public void off()
        {
            //RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows", true);
            RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows", true);

            Console.Clear();
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("Trying to create subkey...");
            try
            {
                rk = rk.CreateSubKey("WindowsUpdate");
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("subkeay created at " + rk.ToString());
                rk.Close();
                RegistryKey rk2 = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate", true);
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("setting value at " + rk2.ToString());
                rk2.SetValue("AU", 2);
                rk2.Close();
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("successfully set to 'notify before download'");
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("now trying to disable the whole auto update (beta)");
                RegistryKey rk3 = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate", true);
                try
                {
                    Console.WriteLine("writing key....");
                    Console.ForegroundColor = ConsoleColor.Green;
                    rk3 = rk3.CreateSubKey("AU");
                    rk3.SetValue("NoAutoUpdate", 1);
                    Console.WriteLine("successfully disabled the auto update");
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("!- Restart your Pc now -!");
                    Console.ForegroundColor = ConsoleColor.White;
                }
                catch (Exception ex3)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("error: " + ex3);
                    Console.ReadKey();
                    Console.Clear();
                    cl.commandlist();
                }
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(ex);
                Console.ReadKey();
                Console.Clear();
                cl.commandlist();
            }
        }
예제 #2
0
        public bool checkOS()
        {
            string OSv = System.Environment.OSVersion.ToString();

            if (OSv.Contains("6.1."))
            {
                Console.WriteLine("Windows 7 and lower is not supported, will be added later");
                cl.commandlist();
                return(false);
            }
            else
            {
                return(true);
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            string getcommand;

            Console.WriteLine("Windows Manager by Exptixone startet successfully\n");
            Console.ForegroundColor = ConsoleColor.White;
            commands         commandliste    = new commands();
            twitch           twitchcommand   = new twitch();
            verify1          verify          = new verify1();
            windows_defender windowsdefender = new windows_defender();
            windowsupdate    autoupdate      = new windowsupdate();

            //verify.verify();

            while (true)
            {
                getcommand = Console.ReadLine();
                switch (getcommand)
                {
                case "commands":    //shows commands
                    commandliste.commandlist();
                    break;

                case "twitch":    //opens twitch with user specific channel name
                    twitchcommand.twitchcommand();
                    break;

                case "clear":    //u know...
                    Console.Clear();
                    break;

                case "defender off":    //disables the defender over the registry
                    windowsdefender.defenderoff();

                    break;

                case "defender on":    //deletes the registry key to re-enable the defender
                    windowsdefender.defenderon();
                    break;

                case "autoupdate off":    //adds 2 registry keys to disable AU first one is for notify 2nd on for complete disable
                    autoupdate.off();
                    break;

                case "autoupdate on":    //maybe need rework , but fixed to 90%
                    autoupdate.on();
                    break;


                default:
                    Console.WriteLine("Unknown command");
                    break;
                }
                System.Threading.Thread.Sleep(200);
            }
        }