通过Powershell配置Windows资源管理器文件夹选项

sta*_*ker 42 registry powershell windows-explorer

我正在寻找一种通过Powershell在Windows资源管理器的"文件夹选项"对话框中配置几个选项的方法.

选项是:

  • 选择"显示隐藏文件,文件夹和驱动器"
  • 取消选中"隐藏已知文件类型的扩展名"
  • 取消选中"隐藏受保护的操作系统文件(推荐)"

guy*_*rad 56

基思的回答对我来说不起作用.修改注册表值的唯一方法是ShowSuperHidden.一旦我在"文件夹设置"中打开"视图"选项卡,隐藏(显示隐藏文件...)和隐藏文件扩展名(隐藏文件扩展名)都会恢复为之前的值.

这是我的解决方案,我在一些试验和错误后发现(explorer.exe自动重启):

$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
Run Code Online (Sandbox Code Playgroud)

我在Windows Server 2008 R2和Windows 7上测试了这个.

  • 同一类别中的另一个,虽然主题启动器没有特别要求,但是:Set-ItemProperty $ key TaskbarGlomLevel 2这将禁用任务栏上类似打开的应用程序的分组.这个还需要重新启动资源管理器进程才能应用它. (3认同)
  • 仍适用于Windows 10 Home Edition (2认同)

Kei*_*ill 7

我相信这些对应于reg键下的注册表项HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced.您可以使用Set-ItemProperty cmdlet更改其值,例如:

$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
Set-ItemProperty $key ShowSuperHidden 1
Run Code Online (Sandbox Code Playgroud)

此外,还似乎是本地机器对应的密钥(而不是每个用户的设定以上): HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder.


小智 7

一些常见的资源管理器调整

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
Run Code Online (Sandbox Code Playgroud)

保存为*.reg,并通过单击或使用reg /import(cli)导入

ps:不需要资源管理器或系统重启