Closed1

WSL から Explorer を開く

nodamushinodamushi

Windows Explorer 召喚スクリプト

以下の explorer を PATH が通っている場所に配置しておくと、WSL から Explorer を簡単に起動できるようになります。

explorer
#!/bin/bash -eu
dir=${1:-.}
if [ ! -e "$dir" ]; then
  echo "[ERROR] Not found: '$dir'"
  exit 1
fi
exec /mnt/c/Windows/explorer.exe "$(wslpath -w "$dir")"
# カレントディレクトリ
explorer

# ホーム
explorer ~

# hoge
explorer ./hoge

通常状態でも explorer.exe . でカレントディレクトリを開くことはできるんだけど、他のディレクトリって開けないんだよね。

で、なんでこんなしょーもないスクラップ作ったの?

wslpath というコマンドを初めて知った情弱老害なので忘れないようにと

このスクラップは2ヶ月前にクローズされました