Show Hidden and Protected Files via Right-click Menu Toggle Option

In order to view protected and hidden files in Explorer, it takes a minimum of six mouse-clicks, which can be a big inconvenience for users. So here comes a script and registry edit that adds the “Show Hidden and Protected Files (toggle)” option to right-click menu.

This option allows you to quickly view hidden and protected Operating System files, without needing to go to Folder Options dialog every time. This is something similar to my other script covered in article Enable or Disable Thumbnail Previews Quickly Using Right-Click Menu in Windows.

Show hidden and protected files via Right-click menu

Download and extract the contents to a folder.

show hidden and protected files

Move the script file showallfiles.vbs to C:\Windows

Double-click showallfiles.reg to create the context menu entries in the registry.

Now, right-click on the Desktop or in an empty area in a folder. You’ll see the option “Show hidden files and folders (toggle)”, which when clicked, displays hidden and protected files. As the name implies it acts as a toggle; clicking this menu option again will turn off display of hidden and protected files.

show hidden and protected files

To remove the option, run the file undo.reg and then manually delete showallfiles.vbs from the Windows directory.

Script Contents

'This script toggles the display of hidden and protected files/folders in Explorer.
'June 16, 2016 - Ramesh Srinivasan for

Set WshShell = CreateObject("WScript.Shell")
strBaseKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\"
strProtected = WshShell.RegRead(strBaseKey & "ShowSuperHidden")

If strProtected = 0 Then
	WshShell.RegWrite strBaseKey & "ShowSuperHidden", 1,"REG_DWORD"
	WshShell.RegWrite strBaseKey & "Hidden", 1,"REG_DWORD"
	WshShell.RegWrite strBaseKey & "ShowSuperHidden", 0,"REG_DWORD"
	WshShell.RegWrite strBaseKey & "Hidden", 2,"REG_DWORD"
End If
WshShell.SendKeys "{F5}"

Feel free to modify the code as per your requirements. Happy computing!

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded in 2005.

1 thought on “Show Hidden and Protected Files via Right-click Menu Toggle Option”

Leave a Comment