Configure Windows Explorer Folder Options through Powershell

stacker picture stacker · Dec 20, 2010 · Viewed 49k times · Source

I'm looking for a way to configure a few options in Folder Option dialog of Windows Explorer through Powershell.

The options are:

  • Choose "Show hidden files, folders, and drives"
  • Uncheck "Hide extensions for known file types"
  • Uncheck "Hide protected operating system files (Recommended)"

Answer

guyarad picture guyarad · Nov 13, 2011

Keith's answer didn't work for me out of the box. The only thing that took to the registry value modification was ShowSuperHidden. Both the Hidden (Show hidden files...) and HideFileExt (hide file extension) reverted back to their previous values as soon as I opened the View tab in Folder Settings.

Here's my solution, which I found after some trial and error (explorer.exe is automatically restarted):

$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
Set-ItemProperty $key Hidden 1
Set-ItemProperty $key HideFileExt 0
Set-ItemProperty $key ShowSuperHidden 1
Stop-Process -processname explorer

I tested this on Windows Server 2008 R2 and Windows 7.