bash on Windows をエクスプローラーから右クリックで一発起動する方法

最近 Windows 10 にも Linuxが動く環境が入りましたね。

bash on Ubuntu on Windows

とか

Windows Subsystem for Linux (WSL)

とか言います。


コマンドプロンプト (cmd.exe) を起動して「bash」を実行すると WSL の環境に入ることが出来ます。


ここでは、エクスプローラーから任意のフォルダで右クリックから

簡単に bash を起動する方法を説明します。


①下記を適当な名前をつけてファイルに保存します。(ここでは例として「openbashere.reg」とする) 

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\openbashhere] 

@="Open Bash here" 

"Icon"="%USERPROFILE%\\AppData\\Local\\lxss\\bash.ico" 

[HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\openbashhere\command] 

@="cmd.exe /c cd /d \"%V\" && bash.exe" 

[HKEY_CURRENT_USER\SOFTWARE\Classes\Drive\shell\openbashhere] 

@="Open Bash here" 

"Icon"="%USERPROFILE%\\AppData\\Local\\lxss\\bash.ico" 

[HKEY_CURRENT_USER\SOFTWARE\Classes\Drive\shell\openbashhere\command] 

@="cmd.exe /c cd /d \"%V\" && bash.exe"


②「openbashhere.reg」をダブルクリックしてWindowsのレジストリにインストールします。

③エクスプローラーの任意のフォルダで右クリックメニューを出します。 

④「Open bash here」が追加されています。


#bash #Windows #エクスプローラー #右クリック

0コメント

  • 1000 / 1000