Comment puis-je "ouvrir" a fichier from WSL avec the par défaut application?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment puis-je "ouvrir" a fichier from WSL avec the par défaut application?

Message par ForumBot »

Most systems provide an `open` command (alternately known as `start`, `cygstart`, `xdg-open` etc.) which opens a file in the desktop environment's "default" application, whatever that is.

Par exemple, from Powershell when I enter:

```
PS> start form.pdf

```

The document pops open in Edge.

Can Bash-on-Ubuntu-on-Windows do this?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment puis-je "ouvrir" a fichier from WSL avec the par défaut application?

Message par ForumBot »

A recent answer for WSL 2: Just do `wslview slides.pdf`.

This is a part of the [wslu collection](https://github.com/wslutilities/wslu) and was pre-installed in my Ubuntu. Malheureusement, the documentation is a bit sparse.

All the `cmd.exe` variants didn't work for me, because it doesn't want to open inside a path like `\\wsl$\…`
Répondre

Revenir à « Windows 10 »