我在win10下装了wsl2, 及ubuntu 20, 并把ubuntu设置为了默认启动,但我在比如C:\Users\apple\Desktop\note\里右键选择打开WSL, ubuntu被启动,但当前目录为系统默认目录,不是C:\Users\shikybird\Desktop\note\这个路径,我电脑重装了,以前是可以显示为当前路径的,从网上搜了半天也没弄明白,求赐教~
1条回答 默认 最新
- 浪客 2022-05-18 15:03关注
把下面内容保存为reg文件,导入到注册表。
这个是系统自带的用wsl打开文件夹,需要在文件夹上按住shift点右键。Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\WSL] @="@wsl.exe,-2" "Icon"="%windir%\\system32\\shell32.dll,88" "Extended"="" "NoWorkingDirectory"="" [HKEY_CLASSES_ROOT\Directory\shell\WSL\command] @="wsl.exe --cd \"%V\""
下面内容则是始终显示用wsl打开的菜单,建议用这个。
Windows Registry Editor Version 5.00 ;右键添加wsl [HKEY_CLASSES_ROOT\Directory\shell\wslnow] @="在WSL中打开当前文件夹" "Icon"="%windir%\\system32\\shell32.dll,88" [HKEY_CLASSES_ROOT\Directory\shell\wslnow\command] @="wsl --cd \"%V\""
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报 编辑记录