Show Hidden Files from the Command Line (Registry)

Toggle Windows' 'show hidden files' and 'show protected OS files' options by editing the Explorer Advanced registry values with reg add.

WindowsregistryFilesHidden filesMedium risk
Run the two reg add commands to set Hidden and ShowSuperHidden to 1 under HKCU\...\Explorer\Advanced, then restart Explorer.

01Command

Command
$ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t REG_DWORD /d 1 /f

02What it does

File Explorer stores the Folder Options checkboxes in the registry: Hidden=1 shows hidden files (2 hides them) and ShowSuperHidden=1 reveals protected system files like desktop.ini and pagefile.sys. Writing the values with reg add changes the same setting as the GUI, but the open Explorer windows won't refresh until you restart Explorer. This is often used after malware hides your folders or when you need a file inside AppData that Explorer isn't showing.

03Risk

RiskMedium risk
RequirementsRestart Explorer (or sign out/in) for the change to take effect.
!Warning: With super-hidden files visible you can now see and delete system files — don't remove anything inside C:\Windows.

04Undo

Undo
$ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 2 /f && reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t REG_DWORD /d 0 /f

05Sources

  • reg add
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: reg add writes a value to a registry key with /v (value name), /t (type) and /d (data), which is how the Explorer Advanced options are toggled.
  • Reg - SS64
    SS64 · technical · 2026-09-17
    Evidence: Documents reg add syntax for changing HKCU Explorer Advanced values such as Hidden to show hidden files.

Last verified: 2026-09-18 · Category: Files & Folders

06Related solutions