AnsiConsole.MarkupLine("[bold]Version[/]: v1.0");
AnsiConsole.MarkupLine("[bold]Developer[/]: ShadesOfDeath");
var tasks = new (string, Action)[]
{
("Activating the Old Context Menu..", () => RegHelper.SetValue(RegistryHive.CurrentUser, @"Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32", "", "", RegistryValueKind.String)),
("Disabling Superfetch..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters", "EnableSuperfetch", 1, RegistryValueKind.DWord)),
("Disabling System Restore..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore", "DisableSR", 1, RegistryValueKind.DWord)),
("Disabling Fast Startup..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SYSTEM\CurrentControlSet\Control\Session Manager\Power", "HiberbootEnabled", 0, RegistryValueKind.DWord)),
("Disabling Modern Standby..", () => RegHelper.TryDeleteKey(RegistryHive.LocalMachine, @"SYSTEM\CurrentControlSet\Control\Power", "PlatformAoAcOverride")),
("Setting Explorer This PC..", () => RegHelper.SetValue(RegistryHive.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "LaunchTo", 1, RegistryValueKind.DWord)),
("Disabling AutoPlay..", () => RegHelper.SetValue(RegistryHive.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers", "DisableAutoplay", 0, RegistryValueKind.DWord)),
("Disabling Thumbnail Previews in File Explorer", () => RegHelper.SetValue(RegistryHive.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "IconsOnly", 1, RegistryValueKind.DWord)),
("Disabing Memory Compression..", () => Process.Start(new ProcessStartInfo { FileName = "powershell", Arguments = "Disable-MMAgent -mc", UseShellExecute = false, RedirectStandardOutput = true, CreateNoWindow = true })),
("Disabling Storage Sense..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\StorageSense", "AllowStorageSenseGlobal", 0, RegistryValueKind.DWord)),
("Disabling Program Compatibility Assistant..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\AppCompat", "DisablePCA", 1, RegistryValueKind.DWord)),
("Disabling Hibernation..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SYSTEM\CurrentControlSet\Control\Power", "HibernateEnabled", 0, RegistryValueKind.DWord)),
("Disabling NTFS Last Access Time Stamp..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SYSTEM\CurrentControlSet\Control\FileSystem", "NtfsDisableLastAccessUpdate", 80000003, RegistryValueKind.DWord)),
("Disabling Telemetry..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\DataCollection", "AllowTelemetry", 0, RegistryValueKind.DWord)),
("Disabling Advertising ID..", () => RegHelper.SetValue(RegistryHive.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo", "DisabledByGroupPolicy", 1, RegistryValueKind.DWord))
};
foreach (var task in tasks)
{
AnsiConsole.MarkupLine($"[green]►[/] {task.Item1}");
var progress = new ProgressBar(Padding.NoPadding(), new ProgressBarStyle
{
ProgressCharacter = '─',
CompletedCharacter = '─',
LeftEndCharacter = '[',
RightEndCharacter = ']',
HintStyle = Style.Plain
});
AnsiConsole.Render(progress);
task.Item2();
Thread.Sleep(1000);
progress.StopTask();
}
AnsiConsole.MarkupLine("[green]All tasks completed![/]");
}
}