简体   繁体   English

从 WSL 启动 Explorer

[英]Launching Explorer from WSL

start . is used to launch an explorer window from cmd.用于从 cmd 启动资源管理器窗口。

When doing the same from wsl, I get当从 wsl 做同样的事情时,我得到

$ start . $ 开始。 start: Unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory开始:无法连接到系统总线:无法连接到套接字/var/run/dbus/system_bus_socket:没有那个文件或目录

Is there an easy way to fix this?有没有简单的方法来解决这个问题?

Since Creators Update you can call Windows executables from WSL if you add the extension file.自 Creators Update 以来,如果添加扩展文件,您可以从 WSL 调用 Windows 可执行文件。 You can open the present folder like this.您可以像这样打开当前文件夹。

explorer.exe .

If you still need start then you can create an alias如果您仍然需要启动,那么您可以创建一个别名

alias start='cmd.exe /c start'

then start .然后start . will work too.也会工作。

You can call Windows executables from WSL but you should add the extension of the file too.您可以从 WSL 调用 Windows 可执行文件,但您也应该添加文件的扩展名。 also there is another problem that in wsl when you want to open a directory in the file explorer, you should use explorer.exe \\\\home\\\\username\\\\projects\\\\ command because windows cannot understand linux standard path slashes.还有一个问题,在 wsl 中,当你想在文件资源管理器中打开一个目录时,你应该使用explorer.exe \\\\home\\\\username\\\\projects\\\\命令,因为 windows 无法理解 linux 标准路径斜杠。 so, I made a wrapper to solve all of these problems.所以,我做了一个包装来解决所有这些问题。 this project is a wrapper between the Linux command-line and windows file-explorer that converts / to \\\\ . 项目是 Linux 命令行和 windows 文件资源管理器之间的包装器,可将/转换为\\\\

with this wrapper you can interact with the windows file-explorer exactly like the linux-native one.使用这个包装器,您可以与 Windows 文件浏览器进行交互,就像 linux 原生的一样。 the below box exhibits the way you can open file explorer using this wrapper.下面的框展示了您可以使用包装器打开文件资源管理器的方式。

explorer /home/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM