using System.Diagnostics;

namespace SolviaOneDriveKillerLib.Helpers
{
    public class ExplorerRestarter
    {
        public static void RestartExplorer()
        {
            // Stop explorer.exe
            foreach (var process in Process.GetProcessesByName("explorer"))
            {
                process.Kill(); // Terminates the process
                process.WaitForExit(); // Optionally, wait for the process to exit
            }

            // Start explorer.exe
            Process.Start("explorer.exe");
        }
    }
}
