This guide shows you how to automatically hide all desktop icons on Windows 10, either with a single right-click or by using a small script for a toggle button. You’ll learn both methods, plus how to restore icons when you need them again. No extra software is required for the basic method, and the script method uses only built-in Windows tools.
What You’ll Need
- A PC running Windows 10 (any recent version).
- Administrator rights are not required for the right-click method.
- For the script method: Notepad (built-in) and permission to save a file to your Desktop or another folder.
Step-by-Step
Method 1: Quick Right-Click Toggle (No Script)
- Right-click on an empty area of your desktop. Make sure you’re not clicking on an icon or a window that covers the desktop.
- In the context menu that appears, hover over View.
- In the submenu, click Show desktop icons to uncheck it (the checkmark disappears). All icons vanish immediately.
- To bring them back, repeat the same steps and click Show desktop icons again to re-check it.
This is the simplest method, but it requires two clicks each time. If you want a one-click toggle, use Method 2.
Method 2: One-Click Toggle with a Script
This method creates a small script that toggles the icon visibility. You can pin it to your taskbar or place it on your desktop for quick access.
- Open Notepad (press Win + R, type
notepad, and press Enter). - Copy and paste the following lines exactly as shown:
@echo off
powershell -command "$p='HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'; $v=(Get-ItemProperty -Path $p -Name 'HideIcons').HideIcons; if($v -eq 1){Set-ItemProperty -Path $p -Name 'HideIcons' -Value 0}else{Set-ItemProperty -Path $p -Name 'HideIcons' -Value 1}; Stop-Process -Name explorer -Force"
- Click File > Save As.
- In the “Save as type” dropdown, select All Files (*.*).
- Name the file
ToggleDesktopIcons.bat(the.batextension is critical). Choose a location like your Desktop or a folder you can pin. - Click Save.
- Double-click the
.batfile to run it. Your desktop icons will hide. Double-click again to show them. - To make it even easier, right-click the
.batfile and select Pin to taskbar or Pin to Start.
Note: The script briefly restarts Windows Explorer (the taskbar and open File Explorer windows may flicker). This is normal and necessary to apply the change instantly.
Common Mistakes
- Right-clicking on a file or folder – The “Show desktop icons” option only appears when you right-click on an empty area of the desktop. If you right-click on an icon, you’ll see a different menu.
- Saving the script with a .txt extension – If Notepad saves the file as
ToggleDesktopIcons.bat.txt, it won’t run as a script. Always choose “All Files” and type the extension yourself. - Using a single backslash in the registry path – The script uses double backslashes (
\\) inside the PowerShell command because it’s within a batch file. If you remove them, the script will fail. - Forgetting that the right-click method is a temporary toggle – Windows does not remember the “hide” state across reboots. If you reboot, icons will reappear. The script method also does not persist across reboots unless you run it again.
Tips
- If you want to hide icons automatically every time Windows starts, place a shortcut to the
.batfile in the Startup folder. Press Win + R, typeshell:startup, and press Enter. Copy the shortcut there. - You can also use the right-click method to temporarily hide icons when you want a clean screenshot or to reduce distractions.
- If you only want to hide specific icons (like Recycle Bin), right-click the desktop, select Personalize > Themes > Desktop icon settings, and uncheck the ones you don’t need.
Troubleshooting
Icons don’t hide after running the script.
Make sure you double-clicked the correct file (the .bat file, not a .txt). If the script runs but nothing happens, try running it as administrator: right-click the file and select “Run as administrator.” Also, check if your antivirus is blocking the PowerShell command – temporarily disable it and test.
The right-click menu doesn’t show “Show desktop icons.”
This happens if you are in Tablet Mode or if the desktop is not the active window. Click on the desktop first, then right-click. If you’re in Tablet Mode, go to Settings > System > Tablet and switch to Desktop mode.
After running the script, the taskbar disappears for a few seconds.
This is normal because the script restarts Explorer. Wait a few seconds and it will come back. If it doesn’t, press Ctrl + Shift + Esc to open Task Manager, click “File” > “Run new task,” type explorer.exe, and press Enter.
Icons reappear after reboot.
As mentioned, the setting is not persistent. To make it persistent, use the Startup folder tip above.
Frequently Asked Questions
Will hiding desktop icons speed up my PC?
No, not noticeably. The icons are just shortcuts; they consume very little memory. Hiding them is purely aesthetic or for reducing clutter.
Can I hide icons on only one monitor (if I have multiple)?
No, the setting applies to all monitors. Windows does not support per-monitor desktop icon visibility.
Does the script work on Windows 11?
Yes, the same registry key and PowerShell command work on Windows 11 as well. The right-click menu is slightly different, but the “Show desktop icons” option is still under View.
Will hiding icons affect my files or folders?
No, it only hides the shortcuts and files displayed on the desktop. The actual files remain in their original locations and are still accessible via File Explorer.
How do I restore icons if the script is lost?
You can always use the right-click method to show them again. Or recreate the .bat file with the same code.
Is it safe to use a .bat file?
Yes, as long as you created it yourself and understand what it does. This script only changes one registry value and restarts Explorer. It does not delete anything.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- How to Enable Desktop Slideshow in Windows 10
- BattlEye Service Failed: Test Signing Fix
- Chrome Remote Desktop on Chromebook: Setup Guide
- App Store Missing on iPad? Fix It
- Ways to Create More Disk Space in Windows 10
- Best CSS Frameworks: How to Choose