答案1
我还没有升级到Win11,但是如果文件夹仍然在注册表项下保存其视图:
HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags
然后是以下内容电源外壳将在显示该列的所有已保存视图中将列宽缩小File Extension
至预设宽度 ( ) 。$NewWidth
File Extension
然后,您可以选择将其中任何一个设置为其关联FolderType
通过使用Apply to Folders
。
$NewWidth = 0x35
$Bags = 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags'
$ExtPropKey = [PSCustomObject]@{
'FmtID' = [GUID]'e4f10a3c-49e6-405d-8288-a23bd4eeaa6c'
'PID' = 100
}
$PropKeyAsBytes = $ExtPropKey.FmtID.ToByteArray() + [BitConverter]::GetBytes($ExtPropKey.PID)
$Encoder = [System.Text.Encoding]::GetEncoding(28591)
$RegEx = [Regex]$Encoder.GetString( $PropKeyAsBytes )
gci $Bags -Recurse |
? PSChildName -like '{*}' |
? Property -contains 'ColInfo' |
ForEach-Object{
$ColInfoAsText = $Encoder.GetString(( $ColInfoAsBytes = $_.GetValue('ColInfo') ))
If ( ( $ColumnPresent = $RegEx.Match( $ColInfoAsText ) ).Success )
{
$WidthOffset = $ColumnPresent.Index + 0x14
$ColInfoAsBytes[$WidthOffset] = $NewWidth
$Splat = @{
'Path' = $_.PSPath
'Name' = 'ColInfo'
'Value' = $ColInfoAsBytes
}
Set-ItemProperty @Splat
}
}