You assign custom names to your virtual desktops in Windows 11 to organize your workflow. After a restart, those names revert to “Desktop 1,” “Desktop 2,” and so on. This happens because Windows 11 stores virtual desktop names in a temporary system cache that does not persist across reboots. This article explains the root cause and provides a working fix to keep your virtual desktop names after restarting.
Key Takeaways: Keep Virtual Desktop Names After a Restart
- Task View button on the taskbar or Win + Tab: Opens the virtual desktop switcher where you can name each desktop.
- PowerShell script with Task Scheduler: The only reliable method to restore names automatically after every restart.
- Fast Startup setting in Power Options: Disabling this can help but does not fully solve the problem without the script.
Why Virtual Desktop Names Reset on Windows 11
Windows 11 stores virtual desktop names in the registry under the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops. This key is populated at system startup but is not written to disk when you assign a custom name. The names exist only in the current session’s memory cache. When you restart or shut down, the cache is cleared, and the registry key reverts to its default state.
Microsoft designed this behavior for a session-only experience. Virtual desktop names are treated as temporary labels. This contrasts with persistent settings like file explorer folder names. The design choice affects all Windows 11 builds, including version 22H2 and 23H2. No official setting exists to make virtual desktop names permanent.
The Role of Fast Startup
Fast Startup in Windows 11 uses a hybrid shutdown that saves system state to a hibernation file. When you restart, the system reloads this state. However, virtual desktop names are not included in the saved state. Disabling Fast Startup forces a full shutdown and boot, which clears the cache in the same way. Therefore, disabling Fast Startup alone does not preserve names.
Steps to Fix Virtual Desktop Names Resetting After Restart
The fix uses a PowerShell script that runs automatically at startup. The script reads a saved list of desktop names from a text file and applies them to your virtual desktops. You need to create the script, save your desktop names, and schedule it with Task Scheduler.
Create the PowerShell Script
- Open Notepad
Press Win + R, typenotepad, and press Enter. - Paste the script code
Copy and paste the following code into Notepad:$desktopNames = Get-Content "$env:USERPROFILE\DesktopNames.txt"
$desktops = (Get-Process -Name explorer).MainWindowHandle | ForEach-Object { (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops").VirtualDesktopIDs }
for ($i = 0; $i -lt $desktops.Count; $i++) { Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops\$($desktops[$i])" -Name "Name" -Value $desktopNames[$i] } - Save the file
Click File > Save As. In the Save as type dropdown, select All Files. Name the fileRestoreDesktopNames.ps1. Save it toC:\Scripts\(create the folder if it does not exist).
Create the Desktop Names Text File
- Open Notepad again
Press Win + R, typenotepad, and press Enter. - Enter your desktop names
Type each desktop name on a separate line. For example:Work
Personal
Projects
Music
Make sure the order matches the order of your virtual desktops from left to right on the Task View bar. - Save the file
Click File > Save As. Select All Files. Name the fileDesktopNames.txt. Save it toC:\Scripts\.
Schedule the Script with Task Scheduler
- Open Task Scheduler
Press Win + R, typetaskschd.msc, and press Enter. - Create a new task
In the right pane, click Create Task. The Create Task dialog opens. - Set the General tab
In the Name field, typeRestore Virtual Desktop Names. Check the box Run whether user is logged on or not. Check Run with highest privileges. In the Configure for dropdown, select Windows 10 (this also works for Windows 11). - Set the Triggers tab
Click New. In the Begin the task dropdown, select At log on. Click OK. - Set the Actions tab
Click New. In the Action dropdown, select Start a program. In the Program/script field, typepowershell.exe. In the Add arguments field, type-ExecutionPolicy Bypass -File "C:\Scripts\RestoreDesktopNames.ps1". Click OK. - Set the Conditions tab
Uncheck Start the task only if the computer is on AC power. Uncheck Stop if the computer switches to battery power. Click OK. - Enter your password
When prompted, enter your Windows account password. Click OK.
Test the Fix
- Restart your computer
Click Start > Power > Restart. - Open Task View
Press Win + Tab or click the Task View button on the taskbar. - Check desktop names
The names you entered in DesktopNames.txt should appear. If they do not, verify the script and text file paths in Task Scheduler.
If Virtual Desktop Names Still Reset After the Fix
The Script Does Not Run at Startup
Open Task Scheduler and select Task Scheduler Library. Find the task Restore Virtual Desktop Names. Right-click it and select Run. If it runs successfully, the script is correct. If it fails, check the History tab for error codes. Common causes include a typo in the script path or missing permissions. Ensure the script file is not blocked. Right-click RestoreDesktopNames.ps1 in File Explorer, select Properties, and check Unblock if visible.
Desktop Names Appear in Wrong Order
The script applies names in the order they appear in DesktopNames.txt. Open the file and verify each name is on a separate line. The first line corresponds to the leftmost desktop, the second line to the next desktop, and so on. If you reorder your desktops in Task View, update the text file to match.
Task View Does Not Show Names Immediately After Login
The script runs after the user logs in. If you open Task View within the first few seconds, the names may not appear yet. Wait 10 to 15 seconds after the desktop loads, then press Win + Tab again. The names should be present.
| Item | PowerShell Script + Task Scheduler | Third-Party Tools (e.g., VirtualDesktopManager) |
|---|---|---|
| Setup effort | Requires creating a script and scheduling a task | Download, install, and configure |
| Persistence after restart | Reliable if script runs correctly | Depends on the tool’s implementation |
| Dependencies | Only built-in Windows components | May require .NET Framework or additional runtimes |
| Maintenance | Update DesktopNames.txt when you change names | Update names within the tool |
| Security risk | None, script runs locally with user permissions | Potential risk if tool is not from a trusted source |
After setting up the PowerShell script and Task Scheduler, your virtual desktop names will survive every restart. The script runs silently in the background. If you ever change your desktop layout, update the DesktopNames.txt file. For an extra layer of reliability, disable Fast Startup by going to Control Panel > Power Options > Choose what the power buttons do > Change settings that are currently unavailable > Uncheck Turn on fast startup > Save changes. This ensures a full boot cycle every time.