我在更新win11 24h2后遇到了和你一样的问题,我阅读 https://github.com/microsoft/WSL/issues/10872 并找到了最简单的方法: 前往 https://github.com/microsoft/WSL/releases/tag/2.4.8 下载对应的安装包安装,然后重启explorer即可。
顺带一提,这同时解决了将wsl系统目录固定到快速访问后无法访问无法删除的bug。
锁定的问题。 此问题已从 Microsoft 支持社区迁移。 你可投票决定它是否有用,但不能添加评论或回复,也不能关注问题。
我在更新win11 24h2后遇到了和你一样的问题,我阅读 https://github.com/microsoft/WSL/issues/10872 并找到了最简单的方法: 前往 https://github.com/microsoft/WSL/releases/tag/2.4.8 下载对应的安装包安装,然后重启explorer即可。
顺带一提,这同时解决了将wsl系统目录固定到快速访问后无法访问无法删除的bug。
你好,我从如下两个方面回答你的问题。
首先是没有根本性解决。我之前尝试过完全重新安装 Windows 系统,但是现象依旧。而在我的另一台设备上,却没有任何问题,一切正常。目前我尚不清楚引发此问题的缘由。
其次是,虽然没有根本上解决,但是我通过手动添加的方式,在 Windows 资源管理器的 ‘快速访问’ 中,实现了一个与系统设置高度相似的访问项。
具体操作方法如我前述的那段 bat 批处理脚本。注意以下几个设置项:
按你的需要,修改这两项,其他内容不动。修改完后运行此批处理,然后重启资源管理器或重启操作系统即生效。
如有其他问题,欢迎回复交流!
您好!
是的,我之前已经注意到了这一点,但是我的核心诉求仍然没有解决。
为了方便使用,我使用如下的批处理手动添加了一个快速访问项
@echo off chcp 936 >nul
set custom_clsid={B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}set custom_show_name=WSLset custom_directory=D:\Users\ZhangWeinian\WSL**set custom_icon=C:\Program Files\WSL\wsl.exe,0
*reg query "HKCU\Software\Classes\CLSID%custom_clsid%" >nul 2>&1**if %errorlevel% equ 0 (*reg delete "HKCU\Software\Classes\CLSID%custom_clsid%" /f )
reg add "HKCU\Software\Classes\CLSID%custom_clsid%" /ve /t REG_SZ /d "%custom_show_name%" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d "0x1" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%" /v "SortOrderIndex" /t REG_DWORD /d "0x42" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%\DefaultIcon" /ve /t REG_EXPAND_SZ /d "%custom_icon%" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%\InProcServer32" /ve /t REG_EXPAND_SZ /d "%%systemroot%%\system32\shell32.dll" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%\Instance" /v "CLSID" /t REG_SZ /d "{0E5AAE11-A475-4c5b-AB00-C66DE400274E}" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%\Instance\InitPropertyBag" /v "Attributes" /t REG_DWORD /d "0x11" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%\Instance\InitPropertyBag" /v "TargetFolderPath" /t REG_EXPAND_SZ /d "%custom_directory%" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%\ShellFolder" /v "FolderValueFlags" /t REG_DWORD /d "0x28" /f
reg add "HKCU\Software\Classes\CLSID%custom_clsid%\ShellFolder" /v "Attributes" /t REG_DWORD /d "0xF080004D" /f
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace%custom_clsid%" >nul 2>&1 *if %errorlevel% equ 0 (*reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace%custom_clsid%" /f )
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace%custom_clsid%" /ve /t REG_SZ /d "%custom_show_name%" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "%custom_clsid%" /t REG_DWORD /d "0x1" /f
这与 Windows 自动设置的非常类似,但是一点细节上有所不同。
如果可以,希望告诉我更多信息
----------------------------------------------- 以下内容新建于 2024-12-23 --------------------------------------------
似乎有多人遇到和我一样的情况。为了使用方便,我使用 PowerShell 脚本重新编写了一段代码,功能与上述批处理脚本相同,只是添加了一些提示信息,便于使用者了解执行状态。已经执行过批处理的使用者可以重复执行新的 PowerShell 脚本,但是注意修改代码中的关键项!
$CustomShowName = 'WSL' # 你想要显示的名称,可以自定义 $CustomIcon = 'C:\Program Files\WSL\wsl.exe,0' # 你想要显示的图标,可以自定义 $CustomDirectory = 'D:\Users\ZhangWeinian\WSL' # 你想要显示的目录,可以自定义
$CustomCLSID = '{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}' # 除非你知道此 id 的含义,否则不要修改此项
@( @{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)"'name' = '(default)'; 'type' = 'String'; 'value' = $CustomShowName'info' = '添加 CLSID 并命名扩展名'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)"'name' = 'SortOrderIndex'; 'type' = 'DWord'; 'value' = '0x42''info' = '在导航窗格中设置扩展的位置'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)"'name' = 'System.IsPinnedToNamespaceTree'; 'type' = 'DWord'; 'value' = '0x1''info' = '将扩展添加到导航窗格并使其可见'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)\DefaultIcon"'name' = '(default)'; 'type' = 'String'; 'value' = $CustomIcon'info' = '设置扩展的图标'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)\InProcServer32"'name' = '(default)'; 'type' = 'String'; 'value' = '%SystemRoot%\system32\shell32.dll''info' = '提供承载扩展的 dll'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)\Instance"'name' = 'CLSID'; 'type' = 'String'; 'value' = '{0E5AAE11-A475-4c5b-AB00-C66DE400274E}''info' = '定义实例对象'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)\Instance\InitPropertyBag"'name' = 'Attributes'; 'type' = 'DWord'; 'value' = '0x11''info' = '提供目标文件夹的文件系统属性'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)\Instance\InitPropertyBag"'name' = 'TargetFolderPath'; 'type' = 'String'; 'value' = $CustomDirectory'info' = '设置同步根的路径'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)\ShellFolder"'name' = 'Attributes'; 'type' = 'DWord'; 'value' = '0xf080004d''info' = '设置适当的标志来控制 shell 行为'}@{'path' = "HKCU:\Software\Classes\CLSID$($CustomCLSID)\ShellFolder"'name' = 'FolderValueFlags'; 'type' = 'DWord'; 'value' = '0x228''info' = '设置适当的 shell 标志'}@{'path' = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace$($CustomCLSID)"'name' = '(default)'; 'type' = 'String'; 'value' = $CustomShowName'info' = '显示到左侧导航栏'}@{'path' = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel''name' = $CustomCLSID; 'type' = 'DWord'; 'value' = '0x1''info' = '在桌面隐藏扩展'}) | ForEach-Object { $null = New-ItemProperty -Path $_.path -Name $_.name -PropertyType $_.type -Value $_.value -Force -ErrorAction SilentlyContinue
Write-Host "操作:$($_.info)`n状态:" -NoNewline
if ($?){Write-Host "成功!n" -ForegroundColor Green}else{Write-Host "失败!错误项信息如下:n" -ForegroundColor RedWrite-Host "目录:$($_.path)n名称:$($\_.name)n类型:$($_.type)n值:$($\_.value)n"}}
拷贝上述脚本到一个 ps1 文件中,然后执行(可能需用权限,具体提权/授权方法请自行百度)ps1 脚本,观察输出,如有错误,欢迎回复此帖交流!
您好,
欢迎您咨询微软社区论坛。
请尝试同时勾选“适用于 Linux 的 Windows 子系统”以及“虚拟机平台”功能,然后重启电脑。
重启后在管理员模式下打开 PowerShell 或 Windows 命令提示符,输入 wsl --install 命令,然后重启计算机。
完成后查看Linux功能是否成功启用。
希望对您有所帮助。如果后续有任何疑问,请联系我们。
谨致问候
Jacen