Skip to content

Portable Tool for an Ideal Windows Setup

-opening an explorer without a window

Greedeksd96a5f52c6ad
diff --git a/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs b/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
index 7d5c57de..95c9fc4e 100644
--- a/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
@@ -210,9 +210,10 @@ namespace GTweak.Utilities.Tweaks
if (explorer.Length == 0)
{
using Process launchExplorer = new Process();
- launchExplorer.StartInfo.FileName = $"{Environment.GetEnvironmentVariable("WINDIR")}\\{"explorer.exe"}";
+ launchExplorer.StartInfo.FileName = $@"{Environment.GetEnvironmentVariable("WINDIR")}\explorer.exe";
+ launchExplorer.StartInfo.Arguments = "/factory,{EFD469A7-7E0A-4517-8B39-45873948DA31}";
launchExplorer.StartInfo.UseShellExecute = true;
- launchExplorer.Start();
+ launchExplorer.Start(); ;
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
index d31d70f2..b3d4de8b 100644
--- a/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
@@ -225,31 +225,33 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\SQMClient");
break;
case "TglButton9":
- if (isChoose)
+ Task.Run(delegate
{
- Task.Run(delegate
+ string backupFile = UsePath.Hosts + @" (Default GTweak)";
+ try
{
- BlockSpyDomain(true);
-
- try { File.Delete(UsePath.Hosts + @" (Default GTweak)"); } catch (Exception ex) { Debug.WriteLine(ex.Message); }
+ if (isChoose)
+ {
+ if (File.Exists(backupFile))
+ File.Delete(backupFile);
- File.Move(UsePath.Hosts, UsePath.Hosts + " (Default GTweak)");
- new UnarchiveManager(UsePath.Hosts, Resources.hosts);
- });
- }
- else
- {
- Task.Run(delegate
- {
- try
+ File.Move(UsePath.Hosts, backupFile);
+ new UnarchiveManager(UsePath.Hosts, Resources.hosts);
+ }
+ else
{
- BlockSpyDomain(false);
- File.Copy(UsePath.Hosts + @" (Default GTweak)", UsePath.Hosts, true);
- File.Delete(UsePath.Hosts + @" (Default GTweak)");
+ File.Copy(backupFile, UsePath.Hosts, true);
+
+ if (File.Exists(backupFile))
+ File.Delete(backupFile);
}
- catch (Exception ex) { Debug.WriteLine(ex.Message); }
- });
- }
+
+ }
+ catch (Exception ex) { Debug.WriteLine(ex.Message); }
+
+ BlockSpyDomain(isChoose);
+
+ });
break;
case "TglButton10":
if (isChoose)
diff --git a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
index 5522b97f..a8828a88 100644
--- a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
@@ -183,11 +183,11 @@ namespace GTweak.Utilities.Tweaks
Process[] explorer = Process.GetProcessesByName("explorer");
if (explorer.Length == 0)
{
- launchExplorer.StartInfo.FileName = $@"{Environment.GetEnvironmentVariable("WINDIR")}\{"explorer.exe"}";
+ launchExplorer.StartInfo.FileName = $@"{Environment.GetEnvironmentVariable("WINDIR")}\explorer.exe";
+ launchExplorer.StartInfo.Arguments = "/factory,{EFD469A7-7E0A-4517-8B39-45873948DA31}";
launchExplorer.StartInfo.UseShellExecute = true;
launchExplorer.Start();
}
-
}
}
});
diff --git a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
index 10492ec4..847c1a54 100644
--- a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
@@ -7,8 +7,6 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
-using System.Security.AccessControl;
-using System.Security.Principal;
using System.ServiceProcess;
using System.Threading.Tasks;