0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WindowsエクスプローラーのコンテキストメニューからUbuntu(WSL2)を起動したい

Posted at

WindowsエクスプローラーのコンテキストメニューからWSL2のUbuntuをすぐに起動したいのです。

前提

WSL2にUbutuをインストール済み

設定内容

次の内容を任意のファイル(拡張子は.reg)に保存し、そのファイルをダブルクリックして実行します。
(管理者で実行する必要がある思います)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\WSL-Ubuntu]
@="Ubuntu ‚ÅŠJ‚­"
"Icon"="C:\\Windows\\System32\\wsl.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\WSL-Ubuntu\command]
@="wsl.exe -d Ubuntu -e sh -c \"cd \\\"$(wslpath '%V')\\\"; exec bash\""

確認

正しく設定できるとWindowsエクスプローラーのコンテキストメニューにUbuntu で開くが追加されます。

image.png

余談

  • ターミナルで開くでWindows ターミナルを起動してから、wsl.exeを実行しても同じです。
  • Windows エクスプローダーのアドレスバー(?)にwslと入力して、Enterでも同じです。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?