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:
How do you show or hide Windows hidden files via a command line toggle?
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?
The Answer
SuperUser contributor Steven has the answer for us:
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.
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
Show
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
ToggleHiddenFiles.bat
Hide Protected Operating System Files (Recommended)
Checked
reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v ShowSuperHidden /t REG_DWORD /d 0 /f
Unchecked
reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v ShowSuperHidden /t REG_DWORD /d 1 /f
ToggleSystemFiles.bat
Notes
The changes take place immediately. The program reg requires admin privileges, so the batch files must be run as administrator.