通过 Powershell 配置 Windows 资源管理器文件夹选项 [英] Configure Windows Explorer Folder Options through Powershell
问题描述
我正在寻找一种通过 Powershell 在 Windows 资源管理器的文件夹选项对话框中配置一些选项的方法.
I'm looking for a way to configure a few options in Folder Option dialog of Windows Explorer through Powershell.
选项是:
- 选择显示隐藏的文件、文件夹和驱动器"
- 取消选中隐藏已知文件类型的扩展名"
- 取消选中隐藏受保护的操作系统文件(推荐)"
推荐答案
Keith 的回答 对我不起作用的盒子.唯一需要修改注册表值的是 ShowSuperHidden.打开文件夹设置中的查看"选项卡后,隐藏"(显示隐藏文件...)和 HideFileExt(隐藏文件扩展名)都会恢复到以前的值.
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.
这是我的解决方案,我经过反复试验后发现(explorer.exe 会自动重新启动):
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
我在 Windows Server 2008 R2 和 Windows 7 上对此进行了测试.
I tested this on Windows Server 2008 R2 and Windows 7.
这篇关于通过 Powershell 配置 Windows 资源管理器文件夹选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!