无法在Windows WSL的Ubuntu上使用xdg-open打开文件

问题描述 投票:0回答:1

在Windows 10上安装Ubuntu,运行标准升级并安装xdg-utils之后,我似乎无法使用xdg-open。

我在桌面上创建了一个测试文件夹,其中包含一个空白的html文件/Desktop/test/index.html。

在测试目录中使用xdg-open返回此错误:

$ xdg-open index.html
Start : This command cannot be run due to the error: The
system cannot find the file specified.
At line:1 char:1
+ Start "/mnt/c/Users/Y/desktop/test/index.html"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Pro
   cess], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Micros
   oft.PowerShell.Commands.StartProcessCommand

这是什么原因以及任何解决方案?

linux ubuntu windows-subsystem-for-linux inode xdgutils
1个回答
0
投票

找到了解决方案:

使用wsl-open,通过npm安装

Github:https://github.com/4U6U57/wsl-open

© www.soinside.com 2019 - 2024. All rights reserved.