Skip to content

Portable Tool for an Ideal Windows Setup

-deleting the OneDrive temporary files folder, deleting the icon cache

Greedeks718f8a1cb7cb
diff --git a/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs b/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
index 78c3c7dc..d9ce78a9 100644
--- a/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
@@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
+using System.Security.Cryptography;
using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
@@ -186,7 +187,8 @@ namespace GTweak.Utilities.Tweaks
{
Process.Start(new ProcessStartInfo()
{
- Arguments = @"/c rd /s /q " + Settings.PathSystemDisk + @"\Windows\Temp & rd /s /q " + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) + @"\Temp",
+ Arguments = @"/c rd /s /q " + Settings.PathSystemDisk + @"\Windows\Temp & rd /s /q %localappdata%\Temp &
+ del /a /q ""%localappdata%\IconCache.db"" & del /a /f /q ""%localappdata%\Microsoft\Windows\Explorer\iconcache*""",
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true,
FileName = "cmd.exe"
diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs
index 0d387fdd..e39c2498 100644
--- a/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs
+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs
@@ -268,7 +268,7 @@ namespace GTweak.Utilities.Tweaks
process.Dispose();
}
- string argumentsFolders = @"/c rd /s /q %userprofile%\AppData\Local\Microsoft\OneDrive & rd /s /q ""%allusersprofile%\Microsoft OneDrive""";
+ string argumentsFolders = @"/c rd /s /q %userprofile%\AppData\Local\Microsoft\OneDrive & rd /s /q ""%allusersprofile%\Microsoft OneDrive"" & rd /s /q " + Settings.PathSystemDisk +@"\OneDriveTemp";
if (isLocalAccount)
argumentsFolders += @" & rd /s /q %userprofile%\OneDrive";