Windows 10 has virtual desktops. You can create and close virtual desktops with a keyboard shortcut. Windows 10 normally doesn’t warn you when you’ve opened one too many virtual desktops. It does have a limit to how many virtual desktops you can open but you’re highly unlikely to ever reach that limit. Virtual desktops are great but their performance, specifically how quickly you can switch between them and how many you can open before they start to impact your system’s performance depends on your hardware. If you’ve opened one too many virtual desktops, you need to close them quickly and free up your system’s resources. Here’s how you can close multiple virtual desktops at once.
Close Multiple Virtual Desktops
If your system is snailing by, you can use the Win+Ctrl+ F4 keyboard shortcut to close a virtual desktop. Repeat this shortcut until all your virtual desktops are closed, or until you manage to trim them down to a number your system can handle. Closing a virtual desktop does not close any apps or windows that are open on it.
If you have one too many virtual desktops open for the keyboard shortcut to be a convenient way to close it, you can use a PowerShell script. Microsoft has a PowerShell script called CloseAllVirtualDesktopInWin10 that you can download and run to close multiple virtual desktops.
Extract the script, right-click it and select Run with PowerShell. Double-clicking the .ps1 file will not work as by default Windows doesn’t let you run PowerShell scripts like that.
You might see a prompt in PowerShell asking if you want to allow the script to run and that it is blocked by the execution policy. Allow the script to run and it will close all your virtual desktops. The time it takes will vary because again, this is about your system’s capabilities.
It goes without saying that this script isn’t meant for routine use. It’s for when your system freezes to the point where individually closing virtual desktops one at a time will tax your time. For ordinary everyday use, you should stick to the keyboard shortcut.
To be clear, the system freeze or delay you experience has to do with your system’s capabilities and not a limit that Windows 10 has imposed. You should be able to open 4-6 virtual desktops regardless of how dated your system is but its capabilities will be impacted by the apps you have running. If you have resource hungry apps running on your system, it will affect how many desktops you can comfortably open and switch between without lag.