LoginSignup
1
3

More than 1 year has passed since last update.

Windows Terminalをコンテキストメニューから起動する

Posted at

はじめに

WSL2が起動エラーとなり再インストールをしたら、Windows Terminalが右クリックメニューから起動してもカレントディレクトリがその場所にならなくなった。
そしてWindows Terminalを再インストールしたら、メニューがなくなったので復活させる方法をメモ。

こちらのページを参考にしました。→ https://banatech.net/blog/view/29

レジストリ操作

regeditを起動し以下の以下のキーへ移動。

HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell

新規キー「WindowsTerminal」を作成。(キー名は何でも良い)
作成したらその下に「command」キーを作成。

HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminal\command

右ペインの「(規定)」をダブルクリックし、データに以下を追加。

"C:\Users\{username}\AppData\Local\Microsoft\WindowsApps\wt.exe" "-d" "%V"

{username}は実際のパス(アカウント名)にすること。

これでディレクトリを選択して右クリックするとコマンドが追加されている。(この例だと「WindowsTerminal」が追加)

何もないところで右クリックして起動したい場合は、以下のキーへ同様に作成する。

HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell
1
3
1

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
1
3