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."); } }
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."); } }
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."); } }