Configure Windows Explorer Folder Options through Powershell
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)"
Solution 1:
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.
Solution 2:
sample windows registry (article) script:
Windows Registry Editor Version 5.00
[hkey_current_user\software\microsoft\windows\currentversion\explorer\advanced]
;hide empty drives [uncheck]
"hidedriveswithnomedia"=dword:00000000
;hide extensions for known file types [uncheck]
"hidefileext"=dword:00000000
;show hidden files, folders, and drives [check]
"showsuperhidden"=dword:00000001
;hide folder merge conflicts [uncheck]
"hidemergeconflicts"=dword:00000000
;hide protected operating system files (recommended) [uncheck]
"hidden"=dword:00000001
;use check boxes to select items [check]
"autocheckselect"=dword:00000001
save as *.reg
file, and import by clicking on it and confirming the action, or through issuing the reg /import
(examples) command on file.
ps: no explorer or system restart required
Solution 3:
I believe these correspond to registry entries under reg key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
. You can use the Set-ItemProperty cmdlet to change their value e.g.:
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
Set-ItemProperty $key ShowSuperHidden 1
There also seems to be a corresponding key for local machine (as opposed to the per user setting above): HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder
.