diff --git a/Perfect11.TweaksInterface/TweaksInterface.cs b/Perfect11.TweaksInterface/TweaksInterface.cs
index 593a435..c5d29e2 100644
--- a/Perfect11.TweaksInterface/TweaksInterface.cs
+++ b/Perfect11.TweaksInterface/TweaksInterface.cs
@@ -3,18 +3,23 @@
public interface IPlugin
{
///
- /// The display name of the plugin.
+ /// The display name of the tweak.
///
string Name { get; }
///
- /// A short description of what the plugin does.
+ /// A short description of what the tweak does.
///
string Description { get; }
+ ///
+ /// The category of the tweak
+ ///
+ string Category { get; }
+
///
/// Executes the plugin’s main logic.
///
- void Execute();
+ string Execute();
}
}
diff --git a/Perfect11.sln b/Perfect11.sln
index 90409c3..c4a4594 100644
--- a/Perfect11.sln
+++ b/Perfect11.sln
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.TweaksInterface",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.UninstallOneDrive", "tweaks\Perfect11.Inbox.UninstallOneDrive\Perfect11.Inbox.UninstallOneDrive.csproj", "{AD55727D-A52C-459D-A316-3459AA80050A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.ManageTelemetry", "tweaks\Perfect11.Inbox.ManageTelemetry\Perfect11.Inbox.ManageTelemetry.csproj", "{2F175C96-FDBA-49D8-BE83-1998C1F75FA2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -27,6 +29,10 @@ Global
{AD55727D-A52C-459D-A316-3459AA80050A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD55727D-A52C-459D-A316-3459AA80050A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD55727D-A52C-459D-A316-3459AA80050A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Perfect11/Form1.Designer.cs b/Perfect11/Form1.Designer.cs
index 5201813..d490af5 100644
--- a/Perfect11/Form1.Designer.cs
+++ b/Perfect11/Form1.Designer.cs
@@ -33,6 +33,7 @@
this.controlBoxEdit1 = new ReaLTaiizor.Controls.ControlBoxEdit();
this.pages = new ReaLTaiizor.Controls.PoisonTabControl();
this.welcomePage = new ReaLTaiizor.Controls.PoisonTabPage();
+ this.editionLabel = new ReaLTaiizor.Controls.PoisonLabel();
this.poisonLabel2 = new ReaLTaiizor.Controls.PoisonLabel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.poisonLabel1 = new ReaLTaiizor.Controls.PoisonLabel();
@@ -48,9 +49,8 @@
this.addButton = new ReaLTaiizor.Controls.PoisonButton();
this.LstUWP = new ReaLTaiizor.Controls.PoisonListView();
this.tweaksPage = new ReaLTaiizor.Controls.PoisonTabPage();
- this.tweaksList = new ReaLTaiizor.Controls.PoisonListView();
this.runTweaks = new ReaLTaiizor.Controls.PoisonButton();
- this.editionLabel = new ReaLTaiizor.Controls.PoisonLabel();
+ this.tweaksList = new ReaLTaiizor.Controls.PoisonListView();
this.theme.SuspendLayout();
this.pages.SuspendLayout();
this.welcomePage.SuspendLayout();
@@ -97,7 +97,7 @@
this.pages.Dock = System.Windows.Forms.DockStyle.Fill;
this.pages.Location = new System.Drawing.Point(3, 28);
this.pages.Name = "pages";
- this.pages.SelectedIndex = 2;
+ this.pages.SelectedIndex = 0;
this.pages.Size = new System.Drawing.Size(1323, 732);
this.pages.TabIndex = 1;
this.pages.UseSelectable = true;
@@ -112,7 +112,7 @@
this.welcomePage.Controls.Add(this.poisonLabel1);
this.welcomePage.HorizontalScrollbarBarColor = true;
this.welcomePage.HorizontalScrollbarHighlightOnWheel = false;
- this.welcomePage.HorizontalScrollbarSize = 11;
+ this.welcomePage.HorizontalScrollbarSize = 6;
this.welcomePage.Location = new System.Drawing.Point(4, 38);
this.welcomePage.Name = "welcomePage";
this.welcomePage.Size = new System.Drawing.Size(1315, 690);
@@ -120,7 +120,17 @@
this.welcomePage.Text = "Welcome";
this.welcomePage.VerticalScrollbarBarColor = true;
this.welcomePage.VerticalScrollbarHighlightOnWheel = false;
- this.welcomePage.VerticalScrollbarSize = 45;
+ this.welcomePage.VerticalScrollbarSize = 31;
+ //
+ // editionLabel
+ //
+ this.editionLabel.AutoSize = true;
+ this.editionLabel.BackColor = System.Drawing.Color.Transparent;
+ this.editionLabel.Location = new System.Drawing.Point(16, 656);
+ this.editionLabel.Name = "editionLabel";
+ this.editionLabel.Size = new System.Drawing.Size(183, 20);
+ this.editionLabel.TabIndex = 4;
+ this.editionLabel.Text = "Perfect11 Community Edition";
//
// poisonLabel2
//
@@ -128,7 +138,7 @@
this.poisonLabel2.BackColor = System.Drawing.Color.Transparent;
this.poisonLabel2.Location = new System.Drawing.Point(416, 379);
this.poisonLabel2.Name = "poisonLabel2";
- this.poisonLabel2.Size = new System.Drawing.Size(465, 38);
+ this.poisonLabel2.Size = new System.Drawing.Size(492, 40);
this.poisonLabel2.TabIndex = 3;
this.poisonLabel2.Text = "Perfect11 is a tool made by a guy who loves to optimize Windows.\r\nIt allows to in" +
"stalls apps, remove bloatware, configure services and even more.";
@@ -170,7 +180,7 @@
this.debloatPage.Controls.Add(this.LstUWP);
this.debloatPage.HorizontalScrollbarBarColor = true;
this.debloatPage.HorizontalScrollbarHighlightOnWheel = false;
- this.debloatPage.HorizontalScrollbarSize = 11;
+ this.debloatPage.HorizontalScrollbarSize = 6;
this.debloatPage.Location = new System.Drawing.Point(4, 38);
this.debloatPage.Name = "debloatPage";
this.debloatPage.Size = new System.Drawing.Size(1315, 690);
@@ -178,7 +188,7 @@
this.debloatPage.Text = "Debloat";
this.debloatPage.VerticalScrollbarBarColor = true;
this.debloatPage.VerticalScrollbarHighlightOnWheel = false;
- this.debloatPage.VerticalScrollbarSize = 28;
+ this.debloatPage.VerticalScrollbarSize = 19;
//
// BtnRunUninstaller
//
@@ -216,7 +226,7 @@
this.ChkShowUWPSystem.AutoSize = true;
this.ChkShowUWPSystem.Location = new System.Drawing.Point(5, 650);
this.ChkShowUWPSystem.Name = "ChkShowUWPSystem";
- this.ChkShowUWPSystem.Size = new System.Drawing.Size(123, 15);
+ this.ChkShowUWPSystem.Size = new System.Drawing.Size(134, 17);
this.ChkShowUWPSystem.TabIndex = 8;
this.ChkShowUWPSystem.Text = "Show System Apps";
this.ChkShowUWPSystem.UseSelectable = true;
@@ -303,7 +313,7 @@
this.tweaksPage.Controls.Add(this.tweaksList);
this.tweaksPage.HorizontalScrollbarBarColor = true;
this.tweaksPage.HorizontalScrollbarHighlightOnWheel = false;
- this.tweaksPage.HorizontalScrollbarSize = 10;
+ this.tweaksPage.HorizontalScrollbarSize = 6;
this.tweaksPage.Location = new System.Drawing.Point(4, 38);
this.tweaksPage.Name = "tweaksPage";
this.tweaksPage.Size = new System.Drawing.Size(1315, 690);
@@ -311,7 +321,18 @@
this.tweaksPage.Text = "Tweak";
this.tweaksPage.VerticalScrollbarBarColor = true;
this.tweaksPage.VerticalScrollbarHighlightOnWheel = false;
- this.tweaksPage.VerticalScrollbarSize = 10;
+ this.tweaksPage.VerticalScrollbarSize = 7;
+ //
+ // runTweaks
+ //
+ this.runTweaks.FontSize = ReaLTaiizor.Extension.Poison.PoisonButtonSize.Medium;
+ this.runTweaks.Location = new System.Drawing.Point(1189, 633);
+ this.runTweaks.Name = "runTweaks";
+ this.runTweaks.Size = new System.Drawing.Size(121, 54);
+ this.runTweaks.TabIndex = 3;
+ this.runTweaks.Text = "Run Tweaks";
+ this.runTweaks.UseSelectable = true;
+ this.runTweaks.Click += new System.EventHandler(this.runTweaks_Click);
//
// tweaksList
//
@@ -327,30 +348,9 @@
this.tweaksList.UseSelectable = true;
this.tweaksList.Resize += new System.EventHandler(this.tweaksList_Resize);
//
- // runTweaks
- //
- this.runTweaks.FontSize = ReaLTaiizor.Extension.Poison.PoisonButtonSize.Medium;
- this.runTweaks.Location = new System.Drawing.Point(1189, 633);
- this.runTweaks.Name = "runTweaks";
- this.runTweaks.Size = new System.Drawing.Size(121, 54);
- this.runTweaks.TabIndex = 3;
- this.runTweaks.Text = "Run Tweaks";
- this.runTweaks.UseSelectable = true;
- this.runTweaks.Click += new System.EventHandler(this.runTweaks_Click);
- //
- // editionLabel
- //
- this.editionLabel.AutoSize = true;
- this.editionLabel.BackColor = System.Drawing.Color.Transparent;
- this.editionLabel.Location = new System.Drawing.Point(16, 656);
- this.editionLabel.Name = "editionLabel";
- this.editionLabel.Size = new System.Drawing.Size(175, 19);
- this.editionLabel.TabIndex = 4;
- this.editionLabel.Text = "Perfect11 Community Edition";
- //
// Form1
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(41)))), ((int)(((byte)(50)))));
this.ClientSize = new System.Drawing.Size(1329, 788);
diff --git a/Perfect11/Form1.cs b/Perfect11/Form1.cs
index eea515e..2beee31 100644
--- a/Perfect11/Form1.cs
+++ b/Perfect11/Form1.cs
@@ -9,6 +9,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Perfect11
{
@@ -272,25 +273,27 @@ namespace Perfect11
{
File.Delete("Tweaks\\Perfect11.TweaksInterface.dll");
}
+ var categorizedPlugins = Utilities.LoadTweaks(@"Tweaks");
tweaksList.View = View.Details;
- tweaksList.Columns.Add("Name", 150);
- tweaksList.Columns.Add("Description", 300);
- tweaksList.FullRowSelect = true;
+ tweaksList.Columns.Clear();
+ tweaksList.Columns.Add("Tweaks", -2, HorizontalAlignment.Left);
int totalWidth = tweaksList.ClientSize.Width;
- tweaksList.Columns[0].Width = (int)(totalWidth * 0.4);
- tweaksList.Columns[1].Width = (int)(totalWidth * 0.6);
-
- // Load plugins
- _tweaks = Utilities.LoadTweaks("Tweaks");
-
- // Populate ListView
- foreach (var plugin in _tweaks)
+ tweaksList.Columns[0].Width = totalWidth;
+ tweaksList.Items.Clear();
+ tweaksList.Groups.Clear();
+ tweaksList.FullRowSelect = true;
+ foreach (var category in categorizedPlugins)
{
- var item = new ListViewItem(plugin.Name);
- item.SubItems.Add(plugin.Description);
- item.Tag = plugin; // store the plugin object for later
- tweaksList.Items.Add(item);
+ var group = new ListViewGroup(category.Key);
+ tweaksList.Groups.Add(group);
+ foreach (var plugin in category.Value)
+ {
+ var item = new ListViewItem(plugin.Name) { Group = group };
+ item.Tag = plugin;
+ tweaksList.Items.Add(item);
+ }
}
+ tweaksList.ShowGroups = true;
if (tweaksList.Items.Count == 0) runTweaks.Enabled = false;
}
private void InitializeDarkMode()
@@ -320,7 +323,8 @@ namespace Perfect11
{
if (item.Tag is IPlugin plugin)
{
- await Task.Run(() => plugin.Execute()); // run in background thread
+ string result = await Task.Run(() => plugin.Execute()); // run in background thread
+ MessageBox.Show(result,"Perfect11",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
}
@@ -337,8 +341,7 @@ namespace Perfect11
private void tweaksList_Resize(object sender, EventArgs e)
{
int totalWidth = tweaksList.ClientSize.Width;
- tweaksList.Columns[0].Width = (int)(totalWidth * 0.4);
- tweaksList.Columns[1].Width = (int)(totalWidth * 0.6);
+ tweaksList.Columns[0].Width = totalWidth;
}
}
}
diff --git a/Perfect11/Library/Utilities.cs b/Perfect11/Library/Utilities.cs
index 41d8189..f91e5a1 100644
--- a/Perfect11/Library/Utilities.cs
+++ b/Perfect11/Library/Utilities.cs
@@ -17,9 +17,9 @@ namespace Perfect11.Library
"CurrentBuildNumber", null);
return int.TryParse(buildNumber, out int build) && build >= 22000;
}
- public static List LoadTweaks(string path)
+ public static Dictionary> LoadTweaks(string path)
{
- var plugins = new List();
+ var categorizedPlugins = new Dictionary>(StringComparer.OrdinalIgnoreCase);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
@@ -33,11 +33,20 @@ namespace Perfect11.Library
foreach (var type in types)
{
if (Activator.CreateInstance(type) is IPlugin plugin)
- plugins.Add(plugin);
+ {
+ var category = string.IsNullOrEmpty(plugin.Category) ? "Uncategorized" : plugin.Category;
+
+ if (!categorizedPlugins.ContainsKey(category))
+ {
+ categorizedPlugins[category] = new List();
+ }
+
+ categorizedPlugins[category].Add(plugin);
+ }
}
}
- return plugins;
+ return categorizedPlugins;
}
public static bool IsAppsDarkMode()
{
diff --git a/tweaks/Perfect11.Inbox.ManageTelemetry/Perfect11.Inbox.ManageTelemetry.csproj b/tweaks/Perfect11.Inbox.ManageTelemetry/Perfect11.Inbox.ManageTelemetry.csproj
new file mode 100644
index 0000000..1eb3d5c
--- /dev/null
+++ b/tweaks/Perfect11.Inbox.ManageTelemetry/Perfect11.Inbox.ManageTelemetry.csproj
@@ -0,0 +1,56 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {2F175C96-FDBA-49D8-BE83-1998C1F75FA2}
+ Library
+ Properties
+ Perfect11.Inbox.ManageTelemetry
+ Perfect11.Inbox.ManageTelemetry
+ v4.8
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ none
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {b3f8761a-b4b2-4378-9fe8-06bbfc39fce6}
+ Perfect11.TweaksInterface
+
+
+
+
\ No newline at end of file
diff --git a/tweaks/Perfect11.Inbox.ManageTelemetry/Properties/AssemblyInfo.cs b/tweaks/Perfect11.Inbox.ManageTelemetry/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..78dad8a
--- /dev/null
+++ b/tweaks/Perfect11.Inbox.ManageTelemetry/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Perfect11 Inbox Tweaks")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Vichingo455")]
+[assembly: AssemblyProduct("Perfect11")]
+[assembly: AssemblyCopyright("Copyright © 2025 Vichingo455")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2f175c96-fdba-49d8-be83-1998c1f75fa2")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/tweaks/Perfect11.Inbox.ManageTelemetry/Tweak.cs b/tweaks/Perfect11.Inbox.ManageTelemetry/Tweak.cs
new file mode 100644
index 0000000..b885560
--- /dev/null
+++ b/tweaks/Perfect11.Inbox.ManageTelemetry/Tweak.cs
@@ -0,0 +1,179 @@
+using Microsoft.Win32;
+using Perfect11.TweaksInterface;
+using System.ServiceProcess;
+using System;
+using System.Management;
+using System.Diagnostics;
+using System.IO;
+
+namespace Perfect11.Inbox.ManageTelemetry
+{
+ public class Tweak : IPlugin
+ {
+ public string Name => "Enable/Disable Telemetry";
+ public string Description => "Enable or Disable Telemetry components.";
+ public string Category => "Privacy";
+ public string Execute()
+ {
+ void ControlService(string serviceName, string action)
+ {
+ try
+ {
+ using (ServiceController sc = new ServiceController(serviceName))
+ {
+ Console.WriteLine($"Service '{serviceName}' current status: {sc.Status}");
+
+ switch (action.ToLower())
+ {
+ case "start":
+ if (sc.Status == ServiceControllerStatus.Stopped)
+ {
+ sc.Start();
+ sc.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(10));
+ Console.WriteLine("Service started successfully.");
+ }
+ else Console.WriteLine("Service is already running.");
+ break;
+
+ case "stop":
+ if (sc.Status == ServiceControllerStatus.Running)
+ {
+ sc.Stop();
+ sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(10));
+ Console.WriteLine("Service stopped successfully.");
+ }
+ else Console.WriteLine("Service is not running.");
+ break;
+
+ case "restart":
+ if (sc.Status == ServiceControllerStatus.Running)
+ {
+ sc.Stop();
+ sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(10));
+ sc.Start();
+ sc.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(10));
+ Console.WriteLine("Service restarted successfully.");
+ }
+ else
+ {
+ sc.Start();
+ sc.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(10));
+ Console.WriteLine("Service started successfully.");
+ }
+ break;
+
+ default:
+ Console.WriteLine("Invalid action. Use start | stop | restart");
+ break;
+ }
+ }
+ }
+ catch (InvalidOperationException ex)
+ {
+ throw new Exception($"Service '{serviceName}' not found or cannot be controlled: {ex.Message}");
+ }
+ catch (System.ServiceProcess.TimeoutException)
+ {
+ throw new Exception("Operation timed out.");
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ }
+ void SetServiceStartupType(string serviceName, string startupType)
+ {
+ try
+ {
+ // startupType can be: "Automatic", "Manual", or "Disabled"
+ string wmiPath = $"Win32_Service.Name='{serviceName}'";
+ using (ManagementObject service = new ManagementObject(wmiPath))
+ {
+ ManagementBaseObject inParams = service.GetMethodParameters("ChangeStartMode");
+ inParams["StartMode"] = startupType;
+ service.InvokeMethod("ChangeStartMode", inParams, null);
+ Console.WriteLine($"Service '{serviceName}' startup type set to {startupType}.");
+ }
+ }
+ catch (ManagementException ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ }
+ bool IsTelemetryActivated()
+ {
+ RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection");
+ int value = (int)rk.GetValue("AllowTelemetry");
+ rk.Close();
+ return value != 0;
+ }
+ if (IsTelemetryActivated())
+ {
+ // Step 1: Registry
+ RegistryKey rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection");
+ rk.SetValue("AllowTelemetry",0,RegistryValueKind.DWord);
+ rk.SetValue("MaxTelemetryAllowed", 0, RegistryValueKind.DWord);
+ rk.Close();
+ rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection");
+ rk.SetValue("AllowTelemetry", 0, RegistryValueKind.DWord);
+ rk.SetValue("MaxTelemetryAllowed", 0, RegistryValueKind.DWord);
+ rk.Close();
+ // Step 2: Stop and Disable Service
+ ControlService("DiagTrack","stop");
+ SetServiceStartupType("DiagTrack","Disabled");
+ // Step 3: Hopefully Disable CompatTelRunner.exe
+ ProcessStartInfo info = new ProcessStartInfo
+ {
+ FileName = "cmd.exe",
+ Arguments = @"/c takeown /F C:\Windows\System32\CompatTelRunner.exe && icacls C:\Windows\System32\CompatTelRunner.exe /grant everyone:F",
+ CreateNoWindow = true,
+ WindowStyle = ProcessWindowStyle.Hidden
+ };
+ var proc = Process.Start(info);
+ proc.WaitForExit();
+ try
+ {
+ File.Move(@"C:\Windows\System32\CompatTelRunner.exe", @"C:\Windows\System32\CompatTelRunner.exe.backup");
+ } catch
+ {
+ throw new Exception("Error while attempting to disable Telemetry file.");
+ }
+ return "Windows Telemetry has been disabled successfully!";
+ }
+ else
+ {
+ // Step 1: Registry
+ RegistryKey rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection");
+ rk.DeleteValue("AllowTelemetry");
+ rk.DeleteValue("MaxTelemetryAllowed");
+ rk.Close();
+ rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection");
+ rk.DeleteValue("AllowTelemetry");
+ rk.DeleteValue("MaxTelemetryAllowed");
+ rk.Close();
+ // Step 2: Enable and Start Service
+ SetServiceStartupType("DiagTrack", "Automatic");
+ ControlService("DiagTrack", "start");
+ // Step 3: Enable back CompatTelRunner.exe
+ ProcessStartInfo info = new ProcessStartInfo
+ {
+ FileName = "cmd.exe",
+ Arguments = @"/c takeown /F C:\Windows\System32\CompatTelRunner.exe.backup && icacls C:\Windows\System32\CompatTelRunner.exe.backup /grant everyone:F",
+ CreateNoWindow = true,
+ WindowStyle = ProcessWindowStyle.Hidden
+ };
+ var proc = Process.Start(info);
+ proc.WaitForExit();
+ try
+ {
+ File.Move(@"C:\Windows\System32\CompatTelRunner.exe.backup", @"C:\Windows\System32\CompatTelRunner.exe");
+ }
+ catch
+ {
+ throw new Exception("Error while attempting to enable back Telemetry file.");
+ }
+ return "Windows Telemetry has been enabled successfully!";
+ }
+ }
+ }
+}
diff --git a/tweaks/Perfect11.Inbox.UninstallOneDrive/Tweak.cs b/tweaks/Perfect11.Inbox.UninstallOneDrive/Tweak.cs
index 85647ef..25ea5bf 100644
--- a/tweaks/Perfect11.Inbox.UninstallOneDrive/Tweak.cs
+++ b/tweaks/Perfect11.Inbox.UninstallOneDrive/Tweak.cs
@@ -14,7 +14,8 @@ namespace Perfect11.Inbox.UninstallOneDrive
{
public string Name => "Uninstall OneDrive";
public string Description => "Remove OneDrive from the system.";
- public void Execute()
+ public string Category => "Apps";
+ public string Execute()
{
// --- Step 0: Check if OneDrive exists ---
bool Exists()
@@ -165,8 +166,7 @@ namespace Perfect11.Inbox.UninstallOneDrive
DeleteTask(@"\OneDrive Reporting Task");
DeleteTask(@"\OneDrive Standalone Update Task");
-
- Console.WriteLine("OneDrive has been completely removed.");
+ return "OneDrive uninstalled successfully.";
}
}
}