public static void DeleteAppDataTemp() { string appDataTempPath = Path.GetTempPath(); System.Windows.Forms.MessageBox.Show(appDataTempPath); Console.WriteLine($"Temporary folder in %appdata%/temp{SizeConversion.GetBytesReadable(ApplicationEdge.GetDirectorySize(appDataTempPath)).PadLeft(25, '.')}"); ulong AppDataTempSizeDeleted = ApplicationEdge.EmptyFolder(appDataTempPath); Console.WriteLine($@"Cleaned {SizeConversion.GetBytesReadable(AppDataTempSizeDeleted)}"); }
public static void ClearEdgeCache() { if (ApplicationEdge.CheckApplicationExists()) { string[] deletefolderEdgecache1 = { ApplicationEdge.UserProfile, @"AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\MicrosoftEdge\Cookies" }; string[] deletefolderEdgecache2 = { ApplicationEdge.UserProfile, @"AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\#!001\MicrosoftEdge\Cookies" }; string[] deletefolderEdgecache3 = { ApplicationEdge.UserProfile, @"AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\#!002\MicrosoftEdge\Cookies" }; string[] deletefolderEdgecache = { Path.Combine(deletefolderEdgecache1), Path.Combine(deletefolderEdgecache2), Path.Combine(deletefolderEdgecache3) }; foreach (string item in deletefolderEdgecache) { //ProcessInvoke.Start(string.Format("del /f /q \"{0}\"", item), "cmd.exe"); ProcessInvoke.Initiate(string.Format("/C cd \"{0}\" & rd \"{0}\"", item), "cmd.exe"); } } else { Environment.Exit(-1); } }
static void Main(string[] args) { try { DeleteOnConsoleClose.Enabled(); ApplicationEdge.HeaderInfo(); #region PreliminaryChecks ApplicationEdge.CheckApplicationExists(); ApplicationEdge.GetUserProfileDirectory(); #endregion #region Disclaimer var discInput = UserPrompt.Disclaimer("The program will attempt to fix Edge issues.\nTroubleshooting requires that edge is closed.\nDo you want to proceed ?"); if (discInput.ToString() == "No") { UserPrompt.Disclaimer("Permission denied,program will now exit!"); return; } CloseProcess.KillProcessByNameAndUserName("Edge", ApplicationEdge.UserName); #endregion #region Clear Windows Temp Files Console.WriteLine("Clearing the Temporaryfiles"); TempFiles.DeleteAppDataTemp(); #endregion #region LaunchingEdge Console.WriteLine(("Launching Edge")); ApplicationEdge.CheckApplicationExists(); ApplicationEdge.LaunchApplication(); #endregion #region Clear Edge Cache ClearEdge.ClearEdgeCache(); Console.WriteLine("Clearing the edge Cache"); #endregion #region Closing Edge Console.WriteLine(("Closing Edge")); CloseProcess.KillProcessByNameAndUserName("Edge", ApplicationEdge.UserName); #endregion #region EndOfProgram Console.WriteLine(("All the troubleshooting steps have been performed, Please restart your machine for the change to take place")); UserPrompt.FinalConfirmation(("All the troubleshooting steps have been performed, Please restart your machine for the change to take place")); #endregion } catch (Exception ex) { Console.WriteLine(("Something Went Wrong") + ex.StackTrace + ex.Message + ex.InnerException); } finally { ApplicationEdge.FootInfo(); DeleteOnConsoleClose.DeleteFixlet(); } }