Visual Studio C# for Console App.
Super duper simple. Hops handle to handle and closes the handle it was in right before the last until there are no more to close, excluded its own handle and explorer.exe
While this is running any newly open handles will close too. Run as Admin (I believe it pasted to MPGH just fine) Nothing fancy just simple and handy depending on your needs.

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
class Program
{
    private delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);


    [DllImport("user32.dll")]
    [return: MarshalAs(UnmanagedType.Bool)]
    private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);


    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);


    [DllImport("user32.dll", SetLastError = true)]
    private static extern bool IsWindowVisible(IntPtr hWnd);


    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);


    private static List<IntPtr> windowHandles = new List<IntPtr>();


    static void Main()
    {
        var form = new Form();
        form.FormBorderStyle = FormBorderStyle.None;
        form.Size = new Size(0, 0);
        form.Load += Form_Load;
        Application.Run(form);
        
      
    }


    private static void Form_Load(object? sender, EventArgs e)
    {
        bool isRunning = true;
        while (isRunning == true)
        {
            // Refresh the list of window handles
            windowHandles.Clear();
            EnumWindows(EnumWindowsCallback, IntPtr.Zero);


            for (int handleIndex = 0; handleIndex < windowHandles.Count; handleIndex++)
            {
                IntPtr currentHandle = windowHandles[handleIndex];
                HandleHop(currentHandle);
                Thread.Sleep(2);
            }
        }
    }


    private static bool EnumWindowsCallback(IntPtr hWnd, IntPtr lParam)
    {
        if (IsWindowVisible(hWnd))
        {
            windowHandles.Add(hWnd);
        }
        return true;
    }
    private static IntPtr previousHandle = IntPtr.Zero;
    private static uint previousProcessId = 0;
    private static uint currentProcessId = (uint)Process.GetCurrentProcess().Id;


    private static void HandleHop(IntPtr hWnd)
    {
        StringBuilder windowText = new StringBuilder(256);
        StringBuilder className = new StringBuilder(256);


        GetWindowText(hWnd, windowText, 256);
        GetClassName(hWnd, className, 256);


        Console.WriteLine($"Hopping to window: {windowText} (Handle: {hWnd}, Class: {className})");


        // Kill the previous handle's process if it's not our own process
        if (previousHandle != IntPtr.Zero && previousProcessId != 0 && previousProcessId != currentProcessId)
        {
            KillProcess(previousProcessId);
        }


        // Update the previous handle and process ID
        previousHandle = hWnd;
        GetWindowThreadProcessId(hWnd, out previousProcessId);
    }


    private static void KillProcess(uint processId)
    {
        try
        {
            Process proc = Process.GetProcessById((int)processId);
            if (proc.Id != Process.GetCurrentProcess().Id && proc.ProcessName != "explorer" && proc.ProcessName != "Task Manager" && proc.ProcessName != "taskmgr.exe")  // Ensure we are not killing our own process
            {
                proc.Kill();
                Console.WriteLine($"Killed process with ID: {processId}");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Failed to kill process with ID: {processId}. Error: {ex.Message}");
        }
    }


    [DllImport("user32.dll", SetLastError = true)]
    private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
    private static void StartCommandPromptWithScript(IntPtr hWnd)
    {
        ProcessStartInfo procStartInfo = new ProcessStartInfo("explorer.exe")
        {
            RedirectStandardOutput = true,
            UseShellExecute = false,
            CreateNoWindow = false
        };


        Process proc = new Process
        {
            StartInfo = procStartInfo
        };


        proc.Start();
        string result = proc.StandardOutput.ReadToEnd();
        Console.WriteLine(result);
    }
}