Bash on Ubuntu on Windows便利ですね。
さらに便利にするためにフォルダ右クリックでそのフォルダをカレントにしてBashを起動できるようにします。
スポンサーリンク
設定方法
このテキスト↓をコピーして、デスクトップなどにinst_bash_on_ubuntu.regというファイル名で保存します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\bash_on_ubuntu] @="Bash on Ubuntu(&B)" [HKEY_CLASSES_ROOT\Directory\Background\shell\bash_on_ubuntu\command] @="cmd.exe /c @pushd \"%V\"&@C:\\Windows\\System32\\bash.exe" [HKEY_CLASSES_ROOT\Directory\shell\bash_on_ubuntu] @="Bash on Ubuntu(&B)" [HKEY_CLASSES_ROOT\Directory\shell\bash_on_ubuntu\command] @="cmd.exe /c @pushd \"%V\"&@C:\\Windows\\System32\\bash.exe" [HKEY_CLASSES_ROOT\Drive\Background\shell\bash_on_ubuntu] @="Bash on Ubuntu(&B)" [HKEY_CLASSES_ROOT\Drive\Background\shell\bash_on_ubuntu\command] @="cmd.exe /c @pushd \"%V\"&@C:\\Windows\\System32\\bash.exe" [HKEY_CLASSES_ROOT\Drive\shell\bash_on_ubuntu] @="Bash on Ubuntu(&B)" [HKEY_CLASSES_ROOT\Drive\shell\bash_on_ubuntu\command] @="cmd.exe /c @pushd \"%V\"&@C:\\Windows\\System32\\bash.exe" |
次にinst_bash_on_ubuntu.regを右クリックして[結合]を実行します。
下の画像のように確認のダイアログが2回出るので、両方とも[はい]をクリックします。
これでフォルダやドライブの右クリックに[Bash on Ubuntu(B)]が表示されます。
これをクリックするとそのフォルダをカレントにBashが起動します。
スポンサーリンク
アンインストール方法
もし、右クリックメニューのBash on Ubuntuを消したくなったら、このテキスト↓をコピーしてuinst_bash_on_ubuntu.regというファイル名で保存します。
1 2 3 4 5 6 7 8 9 |
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT\Directory\Background\shell\bash_on_ubuntu] [-HKEY_CLASSES_ROOT\Directory\Background\shell\bash_on_ubuntu\command] [-HKEY_CLASSES_ROOT\Directory\shell\bash_on_ubuntu] [-HKEY_CLASSES_ROOT\Directory\shell\bash_on_ubuntu\command] [-HKEY_CLASSES_ROOT\Drive\Background\shell\bash_on_ubuntu] [-HKEY_CLASSES_ROOT\Drive\Background\shell\bash_on_ubuntu\command] [-HKEY_CLASSES_ROOT\Drive\shell\bash_on_ubuntu] [-HKEY_CLASSES_ROOT\Drive\shell\bash_on_ubuntu\command] |
あとは、このファイルを右クリックして[結合]を実行すればOKです。