Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- #
- # This will open the Windows File Explorer to the specified directory.
- # - Default directory is present working directory, else $1
- # - If $1 is a filename, then Windows will attempt to open that file.
- #
- # G+ Post: https://plus.google.com/+JessiBaughman/posts/Q7qTDAEHgAP
- # Created by: Jessi A. Baughman
- # Last Modified: 2018-04-04
- # For 'Bash on Ubuntu on Windows' version
- # Must manually expand %localappdata%\lxss
- # Uncomment and replace USERNAME with your Windows account name
- #root='C:\Users\USERNAME\AppData\Local\lxss'
- #For Windows Store WSL Version use (may need to change the 'CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc' directory name):
- #root='C:\Users\USERNAME\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs'
- if [ $# -gt 0 ]; then
- path=$(readlink -f $1)
- else
- path=$(readlink -f .)
- fi
- # Convert / to \
- path=$(echo $path | sed 's/\//\\/g')
- explorer.exe $root$path &>/dev/null
Add Comment
Please, Sign In to add comment