While most of us never need to see or access the hidden files on our Windows systems, others may need to work with them more often. Is there an easy way to toggle back and forth between showing and hiding hidden files? Today’s SuperUser Q&A post has the solution to a frustrated reader’s problem.

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

The Question

SuperUser reader RogUE wants to know how to show or hide Windows hidden files via a command line toggle:

I often need to toggle between showing and hiding the hidden files on my Windows system. I have been doing it the usual way:

  • Click Organize in an Explorer Window
  • Select Folder and Search Options
  • Switch to the View Tab
  • Toggle between Show/Hide Hidden Files

This method is lengthy and I am tired of it. I would like the ability to toggle between showing and hiding them using the Command Line (CMD). Is there a way to set this up for regular files as well as system files?

How do you show or hide Windows hidden files via a command line toggle?

The Answer

SuperUser contributor Steven has the answer for us:

Hidden Files, Folders, or Drives

Add (or overwrite /f) the value Hidden to the registry key:

  • HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced


  • reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v Hidden /t REG_DWORD /d 1 /f

Do not Show

  • reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v Hidden /t REG_DWORD /d 2 /f


Hide Protected Operating System Files (Recommended)


  • reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v ShowSuperHidden /t REG_DWORD /d 0 /f


  • reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v ShowSuperHidden /t REG_DWORD /d 1 /f



The changes take place immediately. The program reg requires admin privileges, so the batch files must be run as administrator.

Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

Akemi Iwaya
Akemi Iwaya has been part of the How-To Geek/LifeSavvy Media team since 2009. She has previously written under the pen name "Asian Angel" and was a Lifehacker intern before joining How-To Geek/LifeSavvy Media. She has been quoted as an authoritative source by ZDNet Worldwide.
Read Full Bio »