Beispiel #1
0
        public ClientHost(RunPowerShell page)
        {
            _id   = Guid.NewGuid();
            _page = page;

            _ui = new ClientHostUserInterface(this);
        }
Beispiel #2
0
 private void DisableWD()
 {
     try
     {
         ConsoleData   = new ObservableCollection <string>();
         IsEnabled     = false;
         ProgBarLength = 1;
         ProgBarValue  = 0;
         run           = new RunPowerShell();
         ConsoleData.Add("Windows Defender is OFF!");
         run.InvokePS("Set-MpPreference -DisableRealtimeMonitoring $true");
         ProgBarValue = 1;
         IsEnabled    = true;
     }
     catch (Exception)
     {
         ConsoleData.Add("\nDisable WD Error!\nOperation failed.");
     }
 }
Beispiel #3
0
 private void DisableUAC()
 {
     try
     {
         ConsoleData   = new ObservableCollection <string>();
         IsEnabled     = false;
         ProgBarLength = 1;
         ProgBarValue  = 0;
         run           = new RunPowerShell();
         run.InvokePS(@"New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force");
         ConsoleData.Add("UAC is Off, System need to reboot to take effect.");
         Thread.Sleep(100);
         ProgBarValue = 1;
         IsEnabled    = true;
         SpaceInfo    = @"Drive C:\" + $"\nTotal size - { DI.TotalSize } Bytes , Free space - { DI.AvailableFreeSpace } Bytes";
     }
     catch (Exception)
     {
         ConsoleData.Add("\nUAC Error!\nOperation failed.");
     }
 }
Beispiel #4
0
 private void DisableRestorePoint()
 {
     try
     {
         run           = new RunPowerShell();
         ConsoleData   = new ObservableCollection <string>();
         IsEnabled     = false;
         ProgBarValue  = 0;
         ProgBarLength = 1;
         run.InvokePS("Disable-ComputerRestore -Drive C:");
         ConsoleData.Add("Restore point was disabled successfully");
         Thread.Sleep(100);
         ProgBarValue = 1;
         IsEnabled    = true;
         SpaceInfo    = @"Drive C:\" + $"\nTotal size - { DI.TotalSize } Bytes , Free space - { DI.AvailableFreeSpace } Bytes";
     }
     catch (Exception)
     {
         ConsoleData.Add("\nRestore-Point Error!\nOperation failed.");
     }
 }